nodes are free (and therefore ready to receive new jobs).
"""
+import os
from Queue import Queue, Empty
import sys
from threading import Thread
'w.run()',
'w.teardown()',
])
- if worker_pool == None:
- worker_pool = MPI.COMM_WORLD.Get_size()
+ if worker_pool is None:
+ worker_pool = int(os.environ.get('WORKER_POOL',
+ MPI.COMM_WORLD.Get_size()))
comm = MPI.COMM_SELF.Spawn( # locks with mpich2 if no mpd running
sys.executable, args=['-c', spawn_script], maxprocs=worker_pool)
rank = comm.Get_rank()