multiprocessing question

N

Neal Becker

I'm using multiprocessing as a crude batch queuing system, like this:

import my_test_program as prog
(where my_test_program has a function called 'run')

def run_test (args):
prog.run (args[1:])

cases = []
for t in test_conditions:
args = [prog.__name__]+[more args...]

cases.append (args)

(leaving out details, but 'cases' will be the list of test cases to run)

results = pool.map (run_test, cases)

Problem is, it doesn't seem to keep all my cpus busy, even though there are
more test cases than cpus. Ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top