Running Fenics on a single process in a parallel code

Dear all,

I have a question regarding the use of fenics.

I have a code (independent of fenics) that makes some calculations. This code is designed to run in parallel as each process is assigned a different task. I would like to assign one process a new task: to call a function that uses fenics (i.e. to read a mesh function) and return some calculations back to the parallel code. Unfortunately, it doesn’t work.

When I call the function that uses fenics (i.e. to read a mesh function) in series, it runs correctly. When I call it via a single process of a parallel script, it doesn’t work, it hangs at the beginning of the function, on the line

mesh = fenics.Mesh()

I’m having trouble diagnosing what could be the reason. A function that runs in series should also run when called from a single process of a parallel code. Any help would be highly appreciated.

Sincerely,

rek

You need to supply an MPI communicator (MPI_COMM_SELF) to your mesh constructor, as explained in: Parallel solving and projecting using comm_world and comm_self - #2 by dokken
and exposed through wrappers: Bitbucket