What is MPI_Error_string?

MPI library

MPI (Message Passing Interface) is a library that enables you to write parallel programs in C or Fortran77. The library uses commonly available operating system services to create parallel processes and exchange information among these processes.

Parallel processing

MPI_Error_string

This method returns a string for an error code.

Syntax

int MPI_Error_string(
  int errorcode,
  char *string,
  int *resultlen
);

Parameters

  • errorcode is the error code returned by an MPI routine or method.

  • string is an output parameter representing the text associated with the error code.

  • resultlen is an output parameter representing the length of the string.

Return value

  • The function returns an error if it is unsuccessful. By default, the error aborts the MPI job.

  • In case of success, it returns MPI_SUCCESS - the value returned upon successful termination of any MPI routine.

  • MPI_ERR_ARG is returned if an argument is invalid.

Free Resources

Copyright ©2026 Educative, Inc. All rights reserved