Non-busy-waiting synchronization for fdm computation
This commit is contained in:
parent
f01789b518
commit
7d86a17130
1 changed files with 12 additions and 0 deletions
12
main.f90
12
main.f90
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue