]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add Kokkos::initalize and finalize to MPI_InitFinalize 14755/head
authorBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 3 Feb 2023 15:03:54 +0000 (10:03 -0500)
committerBruno Turcksin <bruno.turcksin@gmail.com>
Fri, 3 Feb 2023 17:07:52 +0000 (12:07 -0500)
source/base/mpi.cc

index e11ddbec3c8b5f74761be6dae52639491598371e..cd1d1ea8d1ce4a4c25ffd6c5aa160246da9ba5c3 100644 (file)
@@ -30,6 +30,8 @@
 
 #include <boost/serialization/utility.hpp>
 
+#include <Kokkos_Core.hpp>
+
 #include <iostream>
 #include <limits>
 #include <numeric>
@@ -773,6 +775,9 @@ namespace Utilities
       (void)ierr;
 #endif
 
+      // Initialize Kokkos
+      Kokkos::initialize(argc, argv);
+
       // we are allowed to call MPI_Init ourselves and PETScInitialize will
       // detect this. This allows us to use MPI_Init_thread instead.
 #ifdef DEAL_II_WITH_PETSC
@@ -987,6 +992,9 @@ namespace Utilities
 #endif
 
 
+      // Finalize Kokkos
+      Kokkos::finalize();
+
       // only MPI_Finalize if we are running with MPI. We also need to do this
       // when running PETSc, because we initialize MPI ourselves before
       // calling PetscInitialize

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.