Error Handling

Located in file: MEL.hpp

void MEL::Abort(int ierr, const std::string &message)

Calls MPI_Abort with the given error code and prints a string message to stderr.

See
MPI_Comm_rank, MPI_Comm_size, MPI_Error_class, MPI_Error_string, MPI_Abort
Parameters
  • ierr -

    The error code to throw

  • message -

    The message to print to stderr describing what happened

void MEL::Exit(const int errcode)

MEL alternative to std::exit.

Parameters
  • errcode -

    The error code to exit with

void MEL::Exit(const int errcode, const std::string &msg)

MEL alternative to std::exit.

Parameters
  • errcode -

    The error code to exit with

  • msg -

    A message to print to stderr as the program exits

void MEL::DefaultErrorHandler(MPI_Comm *comm, int *ierr, ...)

A default error handler that can be attached to MPI objects to give basic error catching.

See
MPI_Comm_rank, MPI_Comm_size, MPI_Error_class, MPI_Error_string, MPI_Abort
Parameters
  • comm -

    Comm world in which the error occured

  • ierr -

    The error code that was thrown

int MEL::AddErrorClass()

Add an error class for MPI to reference.

See
MPI_Add_error_class
Return
Returns the new error class code that was added

int MEL::AddErrorCode(const int errClass)

Add an error code to an exisiting error class for MPI to reference.

See
MPI_Add_error_code
Return
Returns the new error code that was added
Parameters
  • errClass -

    The error class to add the error code to

int MEL::AddErrorCode()

Add an error code to a new error class for MPI to reference.

Return
Returns the new error code that was added

void MEL::AddErrorString(const int err, const std::string &str)

Add an error string to an existing error code for MPI to reference.

See
MPI_Add_error_string
Parameters
  • err -

    The error code to bind the string to

  • str -

    The error string

int MEL::AddErrorString(const std::string &str)

Add an error string to a new existing error code for MPI to reference.

Return
Returns the new error code added
Parameters
  • str -

    The error string

int MEL::GetErrorClass(const int errCode)

Get the error class code of the given error code.

See
MPI_Error_class
Return
Returns the error class
Parameters
  • errCode -

    The error code

std::string MEL::GetErrorString(const int errCode)

Get the error class code of the given error code.

See
MPI_Error_string
Return
Returns the error class
Parameters
  • errCode -

    The error code

void MEL::ErrorHandlerFree(ErrorHandler &errHndl)

Free an error handler that was previously added.

See
MPI_Errhandler_free
Parameters
  • errHndl -

    The error handler object that references the bound function

void MEL::ErrorHandlerFree(std::vector<ErrorHandler> &errHndls)

Free a vector Error Handlers.

Parameters
  • errHndls -

    A std::vector of Error Handlers

template <typename T0, typename T1, typename... Args>
void MEL::ErrorHandlerFree(T0 &d0, T1 &d1, Args&&... args)

Free the varadic set of error handlers provided.

Parameters
  • d0 -

    The first error handler to free

  • d1 -

    The second error handler to free

  • args -

    The varadic set of remaining error handlers to free