22 void signalHandler(
int signal)
24 std::cerr <<
"[SIGNAL]: Received signal " << signal <<
" (" << strsignal(signal) <<
"), exiting" << std::endl;
32 namespace terminator {
36 std::signal(SIGINT, signalHandler);
37 std::signal(SIGABRT, signalHandler);
38 std::signal(SIGSEGV, signalHandler);
39 std::signal(SIGTERM, signalHandler);
46 if (axom::slic::isInitialized()) {
47 serac::logger::flush();
48 serac::logger::finalize();
51 int mpi_initialized = 0;
52 MPI_Initialized(&mpi_initialized);
53 int mpi_finalized = 0;
54 MPI_Finalized(&mpi_finalized);
55 if (mpi_initialized && !mpi_finalized) {
62 error ? exit(EXIT_FAILURE) : exit(EXIT_SUCCESS);
This file contains the interface used for initializing/terminating any hardware accelerator-related f...
This file contains the all the necessary functions and macros required for logging as well as a helpe...
void terminateDevice()
Cleans up the device, if applicable.
void finalize()
Concludes performance monitoring and writes collected data to a file.
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.
Various helper functions and macros for profiling using Caliper.
Helper functions for exiting Serac cleanly.