]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix race condition in implicit Kokkos initialization 14705/head
authorDaniel Arndt <arndtd@ornl.gov>
Fri, 20 Jan 2023 21:26:07 +0000 (16:26 -0500)
committerDaniel Arndt <arndtd@ornl.gov>
Fri, 20 Jan 2023 21:26:07 +0000 (16:26 -0500)
include/deal.II/lac/vector_memory.templates.h

index ee4fadadd6fed7350cdf39b5e73c0f3cdb13efa8..49e06d7dccd229840aae290eb25bf59c39d9ca3c 100644 (file)
@@ -41,8 +41,8 @@ GrowingVectorMemory<VectorType>::get_pool()
   // finalized past program end together with static variables and we need to
   // make sure to empty the Pool when finalizing Kokkos so that the destruction
   // of the Pool doesn't call Kokkos functions.
-  internal::ensure_kokkos_initialized();
   static auto pool = []() {
+    internal::ensure_kokkos_initialized();
     if (!internal::dealii_initialized_kokkos)
       Kokkos::push_finalize_hook(
         GrowingVectorMemory<VectorType>::release_unused_memory);

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.