RuntimeWarning: mpi4py.MPI.File size changed, may indicate binary incompatibility. Expected 32 from C header, got 40 from PyObject def compile_class(cpp_data, mpi_comm=MPI.comm_world):

Hello everyone, I hope everyone is OK. can you anyone help me to fix a problem.
I am using the Fenics project on ubuntu.
I try to run " import fenics "
I got the following error :
RuntimeWarning: mpi4py.MPI.File size changed, may indicate binary incompatibility. Expected 32 from C header, got 40 from PyObject
def compile_class(cpp_data, mpi_comm=MPI.comm_world):
thank you for your consideration

1 Like

Perhaps it’s an MPI compatibility issue if you installed mpi4py yourself without compiling against your system MPI. If this is the case, you could try:

pip3 install mpi4py --no-binary mpi4py --user --force --no-cache-dir

and hopefully it compiles against your system MPI and reinstalls mpi4py.

Other than this, it’s very difficult to debug without knowing in which environment you’re working, and how you installed FEniCS / MPI etc.

4 Likes

Thank you very much for your help, I try with it, but unfortunately, I got some error.

I solve it by installing the old version mpi4py=3.0.3

2 Likes