IBM Books

MPI Subroutine Reference

MPI_ADD_ERROR_STRING, MPI_Add_error_string

Purpose

Associates an error string with an error code or class.

C synopsis

#include <mpi.h>
int MPI_Add_error_string(int errorcode, char *string);

C++ synopsis

#include mpi.h
void MPI::Add_error_string(int errorcode, const char* string);

FORTRAN synopsis

include 'mpif.h' or use mpi
MPI_ADD_ERROR_STRING(INTEGER ERRORCODE, CHARACTER*(*) STRING, INTEGER IERROR)

Parameters

errorcode
is the error code or class (integer) (IN)

string
is the text corresponding to errorcode (string) (IN)

IERROR
is the FORTRAN return code. It is always the last argument.

Description

This subroutine associates an error string with an error code or class. The string length must be no more than the value specified by MPI_MAX_ERROR_STRING (128 characters).

Notes

The length of the string does not include the null terminator in C or C++. Trailing blanks are deleted in FORTRAN. Calling MPI_ADD_ERROR_STRING for an error code that already has a string will replace the old string with the new string. It is erroneous to call MPI_ADD_ERROR_STRING for an error code or class with a value that is less than or equal to the value specified by MPI_ERR_LASTCODE. In other words, error strings on PE MPI-defined errors cannot be replaced. If MPI_ERROR_STRING is called when no string has been set, it returns a empty string (all spaces in FORTRAN or "" in C and C++).

Errors

Fatal errors:

Error string too long

Improper error message change

Invalid error code

MPI already finalized

MPI not initialized

Related information

MPI_ADD_ERROR_CLASS
MPI_ADD_ERROR_STRING
MPI_ERROR_CLASS
MPI_ERROR_STRING


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]