pathos pool statement gets hanged

My program seems to not proceed further beyond the Pool(5) statement. I am using python 3.6 on windows server, 64 bit virtual machine with 8 virtual CPU's.

Code is as below

import pathos.multiprocessing as mp
 poolObj = mp.Pool(5)     
 docs = poolObj.map(nlp,textStr)

it gets hanged at the statement Pool(5). I tried with ProcessingPool(5) as well, same result.


Solution 1:

I'm the pathos author. First... it helps if you post a code snippet that can be executed by people attempting to answer your question. That helps you get a better answer, as it can be diagnosed better (as in this case, it might be a serialization issue, or it might be the freeze_support windows issue, or it might be a build issue).

Here's what I can suggest in abstract of knowing more details:

  • Do you have a C compiler? If not, then you aren't actually using multiprocess, which is what pathos intends to use. It's a fork of multiprocessing that has more capabilities. If the answer is no, then you need to install one, and then rebuild multiprocess.
  • You don't need to do run within __main__ if you are using multiprocess (see above), however, on windows, you will need to use pathos.helpers.freeze_support. It is required for pools on windows in most cases.
  • If both of the above are fine, then I'd check if your object serializes, and on windows you can confirm if the object will pickle correctly for multiprocess with dill.check (in the dill package).

It also might be a combination of one or more of the above.