Question

I'm a bit of newbie on MPI programming ( mpich2 fedora ). I'm writing be cause, i got Dead lock when use MPI_Barrier with another comunicator different to MPI_COMM_WORLD.

I make 2 communicators like this:

MPI_Comm_split (MPI_COMM_WORLD, color, rank, &split_comm);

If i put a MPI_Barrier where all colors can pass, it'll be all right.

But if i put a MPI_Barrier where only color == 1 can pass, i got Dead lock.

How to use MPI_Barrier with another communicator ? I was also using MPI_Bcast () (with another different communicator MPI_COMM_WORLD) but it wasn't blocked when nobody call MPI_Bcast too. Can one different communicator to MPI_COMM_WORLD synchronise your own processes?

Was it helpful?

Solution

It would be helpful if you could post a code snippet. It's hard to debug a deadlock from your words alone.

At any rate, you pass the communicator you want to block as an argument to MPI_Barrier: http://mpi.deino.net/mpi_functions/mpi_barrier.html http://www.mcs.anl.gov/research/projects/mpi/www/www3/MPI_Barrier.html

MPI_Bcast is a blocking function. So, if one or more ranks do not reach the MPI_Bcast call, then you could have a deadlock.

Remember that MPI_COMM_WORLD includes all ranks, even after the MPI_Comm_Split call.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top