This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

MPI question

0 votes

I was wondering if it was possible to run parts of the python file in parallel and then others sequentially?

asked Mar 12, 2016 by mwathen FEniCS Novice (710 points)

1 Answer

0 votes

You can try inserting something like (untested):

comm = mpi_comm_world()
mpiRank = MPI.rank(comm)
if mpiRank ==0:
   print 'hello'

Each MPI process has a unique MPI 'rank', which is stored in mpiRank in the above. Then you can use an if statement to tell different processes to do different things.

answered Mar 14, 2016 by mwelland FEniCS User (8,410 points)
...