Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

mpi4py: Replace built-in serialization

I'd like to replace MPI4PY's built-in Pickle-serialization with dill. According to the doc the class _p_Pickle should have 2 attributes called dumps and loads. However, python says there are no such attributes when i try the following

from mpi4py Import MPI
MPI._p_Pickle.dumps 

-> AttributeError: type object 'mpi4py.MPI._p_Pickle' has no attribute 'dumps'

Where have dumps and loads gone?

like image 290
OD IUM Avatar asked Nov 29 '25 20:11

OD IUM


1 Answers

In v2.0 you can change it via

MPI.pickle.dumps = dill.dumps
MPI.pickle.loads = dill.loads

It seems that the documentation is still from 2012.

Update For v3.0 see here, i.e.:

MPI.pickle.__init__(dill.dumps, dill.loads)
like image 90
Bourboul Avatar answered Dec 02 '25 10:12

Bourboul