Skip to content

Commit

Permalink
Fix potential deadlock
Browse files Browse the repository at this point in the history
  • Loading branch information
utkinis committed Sep 14, 2023
1 parent 66f102f commit 85883d0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts_future_API/mpi_utils2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,14 @@ mutable struct Exchanger
copyto!(send_buf, border)
KernelAbstractions.synchronize(backend)
send = MPI.Isend(send_buf, comm; dest=rank)
wait(recv)
copyto!(halo, recv_buf)
while true
test_recv = MPI.Test(recv)
test_send = MPI.Test(send)
if test_recv copyto!(halo, recv_buf) end
if test_recv && test_send break end
yield()
end
KernelAbstractions.synchronize(backend)
wait(send)
end
notify(bottom)
end
Expand Down

0 comments on commit 85883d0

Please sign in to comment.