30 if (MPI_Comm_size(comm, &num_procs) != MPI_SUCCESS) {
31 SLIC_ERROR(
"Failed to determine number of MPI processes");
34 if (MPI_Comm_rank(comm, &rank) != MPI_SUCCESS) {
35 SLIC_ERROR(
"Failed to determine MPI rank");
37 return {num_procs, rank};
40 std::pair<int, int>
initialize(
int argc,
char* argv[], MPI_Comm comm)
43 if (MPI_Init(&argc, &argv) != MPI_SUCCESS) {
44 std::cerr <<
"Failed to initialize MPI" << std::endl;
52 if (!logger::initialize(comm)) {
61 #ifdef SERAC_USE_SUNDIALS
62 mfem::Sundials::Init();
This file contains the interface used for initializing/terminating any hardware accelerator-related f...
A function intended to be used as part of a driver to initialize common libraries.
This file contains the all the necessary functions and macros required for logging as well as a helpe...
void initialize([[maybe_unused]] MPI_Comm comm, [[maybe_unused]] std::string options)
Initializes performance monitoring using the Caliper and Adiak libraries.
void registerSignals()
Registers the signalHandler function to handle various fatal signals.
Accelerator functionality.
void exitGracefully(bool error)
Exits the program gracefully after cleaning up necessary tasks.
std::pair< int, int > initialize(int argc, char *argv[], MPI_Comm comm)
Initializes MPI, signal handling, and logging.
std::pair< int, int > getMPIInfo(MPI_Comm comm)
Returns the number of processes and rank for an MPI communicator.
Various helper functions and macros for profiling using Caliper.
Helper functions for exiting Serac cleanly.