Non-busy-waiting synchronization for fdm computation

This commit is contained in:
ignis 2014-07-15 21:37:03 +09:00
parent f01789b518
commit 7d86a17130

View file

@ -20,6 +20,8 @@ program x_code
integer :: n
character :: sym
logical :: flag
real*8 :: dummy
call m_timing_init ! Setting the time zero
call m_openmpi_init
@ -134,6 +136,16 @@ program x_code
call gather_4
if (myid.eq.master) then
call fdm_exe
do id_to=1,numprocs-1
call MPI_Isend (dummy, 1, MPI_REAL, id_to, 0, MPI_COMM_TASK, mpi_request, mpi_err)
end do
else
call MPI_Irecv (dummy, 1, MPI_REAL, master, 0, MPI_COMM_TASK, mpi_request, mpi_err)
do
call MPI_Test(mpi_request, flag, mpi_status, mpi_err)
if (flag) exit
call SLEEPQQ (200)
end do
end if
call MPI_BARRIER(MPI_COMM_TASK, mpi_err)
endif