Joined: 02 Oct 2012
|Posted: Sun Oct 14, 2012 6:30 am Post subject: MPI SSend Recv pair
I've written the following piece of MPI code that would enforce a temporal order on a section of it. It should print 'Hello' in any order, and 'Hello Again' in order by rank. But it is ending up crashing with a signal 11 segmentation fault.
ppinit and ppexit do MPI_Init and MPI_Finalize
rest are integer variables.
write(*,*)"Hello from rank ",me,"of",nvp
if ( me .ne. 0 ) then
call MPI_RECV(zstart, 1, MPI_INTEGER, 0, 0, MPI_COMM_WORLD, ierr)
zstart = 1
if (zstart .eq. 1) then
write(*,*)"Hello Again from rank ",me,"of",nvp
zdone = 1
zdone = 0
if ( me .ne. (nvp-1)) then
call MPI_SSEND(zdone, 1, MPI_INTEGER, 1, 0 , MPI_COMM_WORLD, ierr)
Would appreciate if any MPI users help debug where I am going wrong.