Python: (Pathos) Multiprocessing vs. class methods

后端 未结 2 2014
死守一世寂寞
死守一世寂寞 2021-01-14 12:27

I am trying to parallelize a code using class methods via multiprocessing. The basic structure is the following:

# from multiprocessing import Pool
from path         


        
2条回答
  •  死守一世寂寞
    2021-01-14 13:04

    In multiprocessing function serialization is needed for interprocess communication. Pickle does a poor job for this purpose, install dill via pip instead. Details (with a nice Star Trek example) can be found here: http://matthewrocklin.com/blog/work/2013/12/05/Parallelism-and-Serialization/

提交回复
热议问题