Closed rickstaa closed 5 years ago
@rickstaa: If you are looking to use the "classic" multiprocessing
style init
args, then you need to use a different pool.
Currently you are using a pointer to pathos.pools.ProcessPool
, which has a different __init__
that doesn't include an initializer
. You want pathos.pools._ProcessPool
, which does have an initializer
in __init__
.
Note that the _ProcessPool
has an identical interface to the STL multiprocessing.Pool
, so that means there is no terminate
method, etc.
Try the latter pool above, and close the ticket if it works for you.
@rickstaa: I'm going to assume from the lack of activity here that we have addressed your question. Please reopen this ticket if we have not.
Is there a plan to add a per-worker initialization method to the newer APIs? This seems like super useful/crucial functionality
@CatalinVoss: I don't have an open ticket to add per-worker initialization to the high-level pathos
pools. Note that the functionality is already available on the pools that start with "_
" (pathos.pools._ProcessingPool
).
propagating in https://github.com/uqfoundation/pathos/pull/252
Dear Developer,
I would like to use the initialize option to initialize the pool workers when working with the patho.multiprocessing.ProcessingPool method. However it looks like the initialize method never runs.
Thanks in advance, Greetings, Rick,