You program hangs because the rank 0 process is sending all
messages to rank 1 instead of one message to each rank > 0.
Simply replace the send command in the rank 0 loop over u by
MPI_Send(&t,1,MPI_INT,u,2,MPI_COMM_WORLD);
and everything is working like it should.
Cheers,
Stephan
--
Stephan Mertens @ http://www.uni-magdeburg.de/mertens
Supercomputing in Magdeburg @ http://tina.nat.uni-magdeburg.de
|