Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: submit jobs on multi-core (http://www.velocityreviews.com/forums/t952050-re-submit-jobs-on-multi-core.html)

Laszlo Nagy 09-11-2012 05:53 AM

Re: submit jobs on multi-core
 
On 2012-09-11 06:16, Dhananjay wrote:
> Dear all,
>
> I have a python script in which I have a list of files to input one by
> one and for each file I get a number as an output.
> I used for loop to submit the file to script.
> My script uses one file at a time and returns the output.
>
> My computers has 8 cores.
> Is there any way that I could submit 8 jobs at a time and get all the
> output faster ?
> In other words, how can I modify my script so that I could submit 8
> jobs together on 8 different processors ?
>
> I am bit new to this stuff, please suggest me some directions.

You should first look at the multiprocessing module. It is part of the
standard library.

http://docs.python.org/library/multiprocessing.html



zig-zag 09-11-2012 09:17 AM

Re: submit jobs on multi-core
 
On 09/11/2012 07:53 AM, Laszlo Nagy wrote:
> On 2012-09-11 06:16, Dhananjay wrote:
>> Dear all,
>>
>> I have a python script in which I have a list of files to input one by
>> one and for each file I get a number as an output.
>> I used for loop to submit the file to script.
>> My script uses one file at a time and returns the output.
>>
>> My computers has 8 cores.
>> Is there any way that I could submit 8 jobs at a time and get all the
>> output faster ?
>> In other words, how can I modify my script so that I could submit 8
>> jobs together on 8 different processors ?
>>
>> I am bit new to this stuff, please suggest me some directions.

> You should first look at the multiprocessing module. It is part of the
> standard library.
>
> http://docs.python.org/library/multiprocessing.html
>
>

Did anybody tried this on a cluster?


All times are GMT. The time now is 01:05 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.