From ff90ff0a426e00c88109db76bc8a96f8ed8c5c4a Mon Sep 17 00:00:00 2001 From: Emily Bourne Date: Tue, 27 Jan 2026 11:59:57 +0100 Subject: [PATCH] Add missing ScopeGuards to initialise Kokkos --- src/convergence_order.cpp | 1 + src/strong_scaling.cpp | 3 ++- src/weak_scaling.cpp | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/convergence_order.cpp b/src/convergence_order.cpp index 7b35b992..60cf98a6 100644 --- a/src/convergence_order.cpp +++ b/src/convergence_order.cpp @@ -10,6 +10,7 @@ int main(int argc, char* argv[]) { + Kokkos::ScopeGuard kokkos_scope(argc, argv); omp_set_num_threads(omp_get_max_threads()); const int verbose = 0; diff --git a/src/strong_scaling.cpp b/src/strong_scaling.cpp index 3abb57bb..102d6bc0 100644 --- a/src/strong_scaling.cpp +++ b/src/strong_scaling.cpp @@ -149,8 +149,9 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) << solver.timeAvgMGCResidual() << "," << solver.timeAvgMGCDirectSolver() << std::endl; } -int main() +int main(int argc, char* argv[]) { + Kokkos::ScopeGuard kokkos_scope(argc, argv); omp_set_num_threads(omp_get_max_threads()); std::ofstream outfile("strong_scaling_results.csv"); diff --git a/src/weak_scaling.cpp b/src/weak_scaling.cpp index 2114554b..a4d911ef 100644 --- a/src/weak_scaling.cpp +++ b/src/weak_scaling.cpp @@ -146,8 +146,9 @@ void runTest(int maxOpenMPThreads, int divideBy2, std::ofstream& outfile) << solver.timeAvgMGCResidual() << "," << solver.timeAvgMGCDirectSolver() << std::endl; } -int main() +int main(int argc, char* argv[]) { + Kokkos::ScopeGuard kokkos_scope(argc, argv); omp_set_num_threads(omp_get_max_threads()); std::ofstream outfile("weak_scaling_results.csv");