Initialization Helpers#

group InitializationHelpers
#include "MParT/Initialization.h"

int main( int argc, char* argv[] ) {

  return 0;


void Finalize()#

Call Kokkos::Finalize.

the mpart::Initialize function will set add this function to the atexit list so that it is called at program termination.

template<typename FirstArgType, typename ...Arguments>
void Initialize(FirstArgType &arg1, Arguments... args)#

Calls Kokkos::initialize if it hasn’t been called yet.

This function provides a thin wrapper around the Kokkos::initialize function that can be called multiple times without error. This function also adds Kokkos::finalize to atexit so that manually calling Kokkos::finalize is not necessary.

Note that Kokkos::initialize can only be called once and this function will print a warning message if called multiple times. The warning indicates that any changes to Kokkos parameters, like --kokkos-threads in subsequent calls will have no impact. Only the parameters passed the to the first mpart::Initialize call will be used.

The warning messages can be silenced by setting the MPART_WARNINGS environment variable to OFF.

Template Parameters:



args – Parameters to be passed on to Kokkos::initialize.