Simple Fortran Example (2)
call MPI_SEND( data, 1, MPI_INTEGER, rank+1, 99,
else if (rank .ne. dest) then
call MPI_RECV(data, count, MPI_INTEGER, rank-1,
+ tag, MPI_COMM_WORLD, status, ierr )
call MPI_SEND( data, 1, MPI_INTEGER, rank+1, 99,
call MPI_RECV(data, count, MPI_INTEGER, rank-1,
+ tag, MPI_COMM_WORLD, status, ierr )
print *, rank, ' received', data