169
call MPI_PROBE(MPI_ANY_SOURCE, 5, MPI_COMM_WORLD,
&
status, ierr)
if(status(MPI_SOURCE) .EQ. 1) then
call MPI_RECV(ibuf, 1, MPI_INTEGER, 1, 5,
&
MPI_COMM_WORLD, status, ierr)
call MPI_RECV(rbuf, 1, MPI_REAL, 2, 5,
&
MPI_COMM_WORLD, status, ierr)
else
if(status(MPI_SOURCE) .EQ. 2) then
call MPI_RECV(rbuf, 1, MPI_REAL, 2, 5,
&
MPI_COMM_WORLD, status, ierr)
call MPI_RECV(ibuf, 1, MPI_INTEGER, 1, 5,
&
MPI_COMM_WORLD, status, ierr)
end if
end if
print *, 'Process 0 recv ', ibuf, „ from process 1, ',
&
rbuf, ' from process 2‟
end if
call MPI_FINALIZE(ierr)
end
Достарыңызбен бөлісу: