uqfoundation / pathos

parallel graph management and execution in heterogeneous computing
http://pathos.rtfd.io
Other
1.38k stars 89 forks source link

"chunksize" argument not passed on #152

Closed BeWe11 closed 5 years ago

BeWe11 commented 5 years ago

Hey,

the standard map method of the multiprocessing.Pool class has a chunksize parameter. This parameter is very important to me, because my calculations don't take a lot of time too complete.

As of now, the map method (and all other methods) of the pathos.pools.ProcessPool class does not pass this parameter to the pathos.multiprocessing.Pool class. In fact, it passes no keyword arguments at all.

The ProcessPool.map method returns

return _pool.map(star(f), zip(*args)) # chunksize

There even is a commend # chunksize, maybe it's a TODO reminder? The chunksize is easily passed on if the keyword arguments are passed like this:

return _pool.map(star(f), zip(*args), **kwds) # chunksize

Is there any reason why these parameters are not passed on, especially since there is even a commend indicating that someone thought about the chunksize parameter?

Thank you!

mmckerns commented 5 years ago

There's a reason it's not used, yes. If you want the exact same interface as multiprocessing provides, use pathos.pools._ProcessPool. Close this ticket if the answer is sufficient for your needs.

BeWe11 commented 5 years ago

Thank you for your answer. Although I'm still curious as to what this reason is, this fixes my issue. Thanks!