Skip to content

mpmath objects and mpi (can't pickle matrices) #380

Description

@francismotta

It appears that mpmath objects do not play well with mpi. Consider the following minimal (not) working example (I am running python v3.6.0 with mpmath v1.0.0 and mpi4py v2.0.0):

test.py


from mpi4py import MPI
from mpmath import mp

comm = MPI.COMM_WORLD
num_proc = comm.Get_size()
rank = comm.Get_rank()

if rank == 0:
comm.send(mp.matrix([[1,2],[3,4]]), dest = 1)

if rank == 1:
data = comm.recv(source = 0)


The command mpiexec -n 2 python test.py returns the following error:

_pickle.PicklingError: Can't pickle <class 'mpmath.matrices.matrices.matrix'>: attribute lookup matrix on mpmath.matrices.matrices failed

It appears to be a known issue but without any response regarding a fix. Is there a known work around? Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions