Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28895 > unrolled thread

Re: submit jobs on multi-core

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-09-11 12:41 -0600
Last post2012-09-11 12:41 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: submit jobs on multi-core Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-11 12:41 -0600

#28895 — Re: submit jobs on multi-core

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-09-11 12:41 -0600
SubjectRe: submit jobs on multi-core
Message-ID<mailman.513.1347388927.27098.python-list@python.org>
On Mon, Sep 10, 2012 at 11:53 PM, Laszlo Nagy <gandalf@shopzeus.com> 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

Or if Python 3.2 is an option, the concurrent.futures module would be
very well suited for this task.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web