Skip to content

Commit

Permalink
Init and finalize kokkos in executables
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed Jan 6, 2025
1 parent 1e4ce6f commit cdfafc4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Parallel/Main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "Utilities/ErrorHandling/Error.hpp"
#include "Utilities/FileSystem.hpp"
#include "Utilities/Formaline.hpp"
#include "Utilities/Kokkos/KokkosCore.hpp"
#include "Utilities/MakeString.hpp"
#include "Utilities/Overloader.hpp"
#include "Utilities/StdHelpers.hpp"
Expand Down Expand Up @@ -278,6 +279,10 @@ void AtSyncIndicator<Metavariables>::ResumeFromSync() {

template <typename Metavariables>
Main<Metavariables>::Main(CkArgMsg* msg) {
#ifdef SPECTRE_KOKKOS
Kokkos::initialize(msg->argc, msg->argv);
#endif // SPECTRE_KOKKOS

Informer::print_startup_info(msg);

/// \todo detail::register_events_to_trace();
Expand Down Expand Up @@ -785,6 +790,9 @@ void Main<Metavariables>::execute_next_phase() {

if (Parallel::Phase::Exit == current_phase_) {
check_if_component_terminated_correctly();
#ifdef SPECTRE_KOKKOS
Kokkos::finalize();
#endif // SPECTRE_KOKKOS
return;
}
tmpl::for_each<component_list>([this](auto parallel_component) {
Expand Down

0 comments on commit cdfafc4

Please sign in to comment.