You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sam Reeve edited this page May 18, 2023
·
2 revisions
Cabana is an MPI+Kokkos performance portable library for particle-based simulations. The core Cabana library elements can be used by including Cabana_Core.hpp
Kokkos, as the underlying on-node runtime, must be initialized and finalized. If using MPI capabilities of Cabana, it should be initialized before Kokkos and finalized after Kokkos.
#include<Cabana_Core.hpp>
#include<iostream>intmain( int argc, char* argv[] )
{
/* Kokkos::ScopeGuard initializes Kokkos and guarantees it is finalized. */
Kokkos::ScopeGuard scope_guard(argc, argv);
/* Any code using Cabana should be after the ScopeGuard is constructed. */
std::cout << "Hello world from Cabana!" << std::endl;
return0;
}
See the Hello World Tutorial for an example of Kokkos initialization and finalization.