This is for the external interfaces chapter.
I will prepare a Latex version soon and mail the ps file, and will
also bring a few copies to the meeting. In that version, I will
provide the Fortran and C++ interfaces.
Rajeev
Proposal for functions to add new error classes and error codes
---------------------------------------------------------------
Introduction:
------------
Users may want to write a layered library on top of an existing MPI
implementation, and this library may have its own set of error codes
and classes. An example of such a library is an I/O library based on
the I/O chapter in MPI-2. For this purpose, functions are needed to:
1. added a new error class to the ones an MPI implementation already
knows.
2. associate error codes with this error class, so that
MPI_Error_class() works.
3. associate strings with these error codes, so that
MPI_Error_string() works.
Three new functions are proposed below:
-----------------------------------------------------------------------
MPI_Add_error_class(errorclass)
OUT errorclass Value for the new error class
int MPI_Error_class(int *errorclass)
Creates a new error class and returns the value for it.
Rationale:
To avoid conflicts with existing error codes and classes, the value is
set by the implementation and not by the user.
End of rationale
Advice to Implementors:
The value of MPI_ERR_LASTCODE may need to be modified due to the
addition of a new error class.
End of advice to implementors
-----------------------------------------------------------------------
----------------------------------------------------------------------
MPI_Add_error_codes(errorclass, array_errorcodes, count)
IN errorclass Error class
OUT array_errorcodes Array of new error codes
IN count Number of error codes needed
int MPI_Add_error_codes(int errorclass, int *array_errorcodes, int count)
Creates "count" number of new error codes, associates them with
errorclass, and returns their values in array_errorcodes.
Rationale:
To avoid conflicts with existing error codes and classes, the values
of the new error codes are set by the implementation and not by the
user.
End of rationale
Advice to Implementors:
The value of MPI_ERR_LASTCODE may need to be modified due to the
addition of new error codes.
End of advice to implementors
-----------------------------------------------------------------------
----------------------------------------------------------------------
MPI_Add_error_string(errorcode, string, len)
IN errorcode Error code or class
IN string Text corresponding to errorcode
IN len Length (in printable characters) of
the text in string
int MPI_Add_error_string(int errorcode, char *string, int len)
Associates an error string with an error code or class.
The string must be no more that MPI_MAX_ERROR_STRING characters long.
-----------------------------------------------------------------------