]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Synchronize CUDA device in MPI ghost exchange 8880/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 1 Oct 2019 12:55:49 +0000 (14:55 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 1 Oct 2019 12:55:49 +0000 (14:55 +0200)
include/deal.II/base/partitioner.templates.h

index 167e01c45cea4bed5921955ba0009819acbe586b..da662e10de1eeb3491c67d68b1fb73fe1d47f4cb 100644 (file)
@@ -126,6 +126,7 @@ namespace Utilities
                   import_indices_plain_dev[i].first.get(),
                   locally_owned_array.data(),
                   chunk_size);
+              cudaDeviceSynchronize();
             }
           else
 #    endif
@@ -400,6 +401,11 @@ namespace Utilities
             ExcMessage("Index overflow: Maximum message size in MPI is 2GB. "
                        "The number of ghost entries times the size of 'Number' "
                        "exceeds this value. This is not supported."));
+#    if defined(DEAL_II_COMPILER_CUDA_AWARE) && \
+      defined(DEAL_II_MPI_WITH_CUDA_SUPPORT)
+          if (std::is_same<MemorySpaceType, MemorySpace::CUDA>::value)
+            cudaDeviceSynchronize();
+#    endif
           const int ierr =
             MPI_Isend(ghost_array_ptr,
                       ghost_targets_data[i].second * sizeof(Number),

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.