13 #include "Utilities.h"
14 #include "ParallelBuffer.h"
26 const std::string& message,
27 const std::string& filename,
31 std::ostream perr(&perr_buffer);
32 perr <<
"Program abort called in file ``" << filename
33 <<
"'' at line " << line << std::endl;
34 perr <<
"ERROR MESSAGE: " << std::endl << message.c_str() << std::endl;
38 MPI_Initialized(&mpi_init);
41 MPI_Comm_size(MPI_COMM_WORLD, &size);
43 MPI_Abort(MPI_COMM_WORLD, -1);
58 std::ostringstream os;
59 if (processorID < 0) {
60 os <<
'-' << std::setw(6) << std::setfill(
'0') << -processorID;
62 os << std::setw(7) << std::setfill(
'0') << processorID;
71 const std::string& filename)
74 return (stat(filename.c_str(), &buffer) == 0);
static std::string processorToString(int processorID)
Converts a processor ID to a string. Use this to ensure same width is used when converting a processo...
static bool file_exist(const std::string &filename)
Verifies if a file exists.
static void abort(const std::string &message, const std::string &filename, int line)
Cleanly ends the program when something horrible happened and prints a message about what took place....