From 6a59fc8c1c696481d533f16c49e9665f0e1d7da2 Mon Sep 17 00:00:00 2001 From: Simon Byrne Date: Thu, 19 Oct 2023 13:43:08 -0700 Subject: [PATCH] use blocking synchronize to reduce poll waiting --- src/Spaces/dss_cuda.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Spaces/dss_cuda.jl b/src/Spaces/dss_cuda.jl index b649a56bc9..7afaa5e948 100644 --- a/src/Spaces/dss_cuda.jl +++ b/src/Spaces/dss_cuda.jl @@ -427,13 +427,13 @@ function fill_send_buffer!(::ClimaComms.CUDADevice, dss_buffer::DSSBuffer) if nsend > 0 nitems = nsend * nlevels * nfid nthreads, nblocks = _configure_threadblock(nitems) - CUDA.synchronize() # CUDA MPI uses a separate stream. This will synchronize across streams + CUDA.synchronize(;blocking=true) # CUDA MPI uses a separate stream. This will synchronize across streams @cuda threads = (nthreads) blocks = (nblocks) fill_send_buffer_kernel!( send_data, send_buf_idx, pperimeter_data, ) - CUDA.synchronize() # CUDA MPI uses a separate stream. This will synchronize across streams + CUDA.synchronize(;blocking=true) # CUDA MPI uses a separate stream. This will synchronize across streams end return nothing end @@ -468,13 +468,13 @@ function load_from_recv_buffer!(::ClimaComms.CUDADevice, dss_buffer::DSSBuffer) if nrecv > 0 nitems = nrecv * nlevels * nfid nthreads, nblocks = _configure_threadblock(nitems) - CUDA.synchronize() + CUDA.synchronize(;blocking=true) @cuda threads = (nthreads) blocks = (nblocks) load_from_recv_buffer_kernel!( pperimeter_data, recv_data, recv_buf_idx, ) - CUDA.synchronize() + CUDA.synchronize(;blocking=true) end return nothing end