11 #include "Exception.h" 23 const char *file,
int line,
int echo)
49 const char *file,
int line,
int echo)
91 if (MPI::Is_initialized()) {
92 std::cerr << e.
message() << std::endl;
95 MPI::COMM_WORLD.Abort(65);
std::string & message()
Return the error message.
Utility classes for scientific computation.
void MpiThrow(Exception &e)
Function to throw exception in MPI code.
Exception(const char *function, const char *message, const char *file, int line, int echo=1)
Constructor.
static std::ostream & file()
Get log ostream by reference.
virtual ~Exception()
Destructor.
void write(std::ostream &out)
Write error message to output stream.
static void close()
Close log file, if any.
std::string message_
Error message string.
A user-defined exception.