Hello, I am facing some trouble running my code using the mesh format h5 file in parallel. When I am running in serial, mpirun -n 1 python3 test.py, for instance, it runs. However when I run mpirun -n 4 python3 test.py it returns the error:
solver_disp.solve()
RuntimeError:
*** -------------------------------------------------------------------------
*** DOLFIN encountered an error. If you are not able to resolve this issue
*** using the information listed below, you can ask for help at
*** fenics-support@googlegroups.com
*** Remember to include the error message listed below and, if possible,
*** include a minimal running example to reproduce the error.
*** -------------------------------------------------------------------------
*** Error: Unable to access vector of degrees of freedom.
*** Reason: Cannot access a non-const vector from a subfunction.
*** Where: This error was encountered inside Function.cpp.
*** Process: 3
*** DOLFIN version: 2019.2.0.dev0
*** Git changeset: ubuntu
*** -------------------------------------------------------------------------
solver_disp.solve()
The mesh reading passage is:
mesh = Mesh()
hdf = HDF5File(MPI.comm_world, “file.h5”, “r”) #mesh.mpi_comm()
hdf.read(mesh, “/mesh”, False)
cd = MeshFunction(“size_t”, mesh, mesh.topology().dim())
hdf.read(cd, “/cd”)
fd = MeshFunction(“size_t”, mesh, mesh.topology().dim()-1)
hdf.read(fd, “/fd”)
When I add the line:
MeshPartitioning.build_distributed_mesh(mesh)
it does run, but the processes seem not to be communicating among themselves, and my mesh becomes weirdly fractioned. I’ll post an image of it.
My mesh is a cube with an sphere inside of it. the Cube region is marked with label 2 and the sphere with label 1.
The code and the files are in GitHub - DeisonPreve/HDF5File-in-parallel
Thanks in advance.