MPI-aware logger that handles rank filtering and quiet mode.
More...
#include <mpi_logger.hpp>
|
| | MPILogger (int rank, bool quiet=false) |
| | Constructs an MPI logger.
|
| |
| void | log (const std::string &message) const |
| | Logs a message to stdout (rank 0 only, respects quiet mode).
|
| |
| void | error (const std::string &message) const |
| | Logs an error message to stderr (rank 0 only).
|
| |
| void | exitWithError (const std::string &message) const |
| | Logs an error and terminates the program.
|
| |
MPI-aware logger that handles rank filtering and quiet mode.
Encapsulates MPI rank and quiet mode to simplify logging calls throughout the codebase. Only rank 0 outputs messages, and quiet mode can suppress output.
◆ MPILogger()
| MPILogger::MPILogger |
( |
int |
rank, |
|
|
bool |
quiet = false |
|
) |
| |
|
inline |
Constructs an MPI logger.
- Parameters
-
| rank | MPI rank of the current process |
| quiet | If true, suppresses non-error output |
◆ error()
| void MPILogger::error |
( |
const std::string & |
message | ) |
const |
|
inline |
Logs an error message to stderr (rank 0 only).
- Parameters
-
| message | Error message to log |
◆ exitWithError()
| void MPILogger::exitWithError |
( |
const std::string & |
message | ) |
const |
|
inline |
Logs an error and terminates the program.
- Parameters
-
| message | Error message before exit |
◆ log()
| void MPILogger::log |
( |
const std::string & |
message | ) |
const |
|
inline |
Logs a message to stdout (rank 0 only, respects quiet mode).
- Parameters
-
The documentation for this class was generated from the following file: