From 4ea34ebe1e25beb3917b12aea6813d7816e9f46c Mon Sep 17 00:00:00 2001 From: Bruno Turcksin Date: Fri, 3 Feb 2023 10:03:54 -0500 Subject: [PATCH] Add Kokkos::initalize and finalize to MPI_InitFinalize --- source/base/mpi.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/base/mpi.cc b/source/base/mpi.cc index e11ddbec3c..cd1d1ea8d1 100644 --- a/source/base/mpi.cc +++ b/source/base/mpi.cc @@ -30,6 +30,8 @@ #include +#include + #include #include #include @@ -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 -- 2.39.5