Hi everyone,
I have posted a few post recently about MPI code, here is a new one. This is definitely a hard step for beginner in parallel computation as i am.
Please consider my issue:
In a first py program (without mpi), i create a mesh and several submeshes:
#...
# Create submesh
mesh_phase_A = SubMesh(mesh_Vol_TOT, subdomains_Vol_TOT, id_A)
# Save submesh
File(Folder_Mesh_fenics + 'DOMAIN_mesh_A.xml.gz') << mesh_phase_A
Then, in a second program (with MPI this time), i import ONE of these submesh:
(-> so i don't have to use submesh, which is not supported in parallel)
mpirun -np 4 python second_program.py
mesh_phase = Mesh(filepath)
If i plot it, i can see the mesh has been correctly partitioned between the different process
plot_title= 'MESH for the process: {value}'.format(value=rank_process)
plot(mesh_phase, title=plot_title, interactive=True)
But then, when i create the function space
V = FunctionSpace(mesh_phase, 'Lagrange', 1)
I get this error from all process:
[0]PETSC ERROR: ------------------------------------------------------------------------
[0]PETSC ERROR: Caught signal number 11 SEGV: Segmentation Violation, probably memory access out of range
[0]PETSC ERROR: Try option -start_in_debugger or -on_error_attach_debugger
[0]PETSC ERROR: or see http://www.mcs.anl.gov/petsc/documentation/faq.html#valgrind
[0]PETSC ERROR: or try http://valgrind.org on GNU/linux and Apple Mac OS X to find memory corruption errors
[0]PETSC ERROR: configure using --with-debugging=yes, recompile, link, and run
[0]PETSC ERROR: to get more information on the crash.
--------------------------------------------------------------------------
MPI_ABORT was invoked on rank 0 in communicator MPI_COMM_WORLD
with errorcode 59.
Where is the error? I believe it's because the imported mesh is a submesh (created in the 1st program).
How could i ask FEniCS to consider this submesh as a mesh?
Thanks for any help.
EDIT: when i run the second program with only one process (mpirun -np 1 *), everything works correctly.