Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |  

This web mail archive is frozen.

This page is part of a frozen web archive of this mailing list.

You can still navigate around this archive, but know that no new mails have been added to it since July of 2016.

Click here to be taken to the new web archives of this list; it includes all the mails that are in this frozen archive plus all new mails that have been sent to the list since it was migrated to the new archives.

Subject: [OMPI devel] Issues with MPI_Add_error_class()
From: Lisandro Dalcin (dalcinl_at_[hidden])
Date: 2014-04-21 08:45:55


It seems the implementation of MPI_Add_error_class() is out of sync
with the definition of MPI_ERR_LASTCODE.

Please review the list of error classes in mpi.h and the code in this
file: https://bitbucket.org/ompiteam/ompi-svn-mirror/src/v1.8/ompi/errhandler/errcode.c

BTW, in that file, all the MPI_T_ERR_XXX are not handled. The MPI-3
standard says they should be treated as other MPI error classes.
Trying to get an error string out of them (eg. MPI_T_ERR_MEMORY)
generates an error.

[dalcinl_at_kw2060 openmpi]$ cat add_error_class.c
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[])
{
  int errorclass,*lastused,flag;
  MPI_Init(&argc, &argv);
  MPI_Add_error_class(&errorclass);
  MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_LASTUSEDCODE, &lastused, &flag);
  printf("errorclass:%d lastused:%d MPI_ERR_LASTCODE:%d\n",
errorclass, *lastused, MPI_ERR_LASTCODE);
  MPI_Finalize();
  return 0;
}
[dalcinl_at_kw2060 openmpi]$ mpicc add_error_class.c
[dalcinl_at_kw2060 openmpi]$ ./a.out
errorclass:54 lastused:54 MPI_ERR_LASTCODE:71

[dalcinl_at_kw2060 openmpi]$ cat error_string.c
#include <stdio.h>
#include <mpi.h>
int main(int argc, char *argv[])
{
  char errorstring[MPI_MAX_ERROR_STRING];
  int slen;
  MPI_Init(&argc, &argv);
  MPI_Error_string(MPI_T_ERR_MEMORY, errorstring, &slen);
  printf("errorclass:%d errorstring:%s\n", MPI_T_ERR_MEMORY, errorstring);
  MPI_Finalize();
  return 0;
}
[dalcinl_at_kw2060 openmpi]$ mpicc error_string.c
[dalcinl_at_kw2060 openmpi]$ ./a.out
[kw2060:20883] *** An error occurred in MPI_Error_string
[kw2060:20883] *** reported by process [140737332576257,0]
[kw2060:20883] *** on communicator MPI_COMM_WORLD
[kw2060:20883] *** MPI_ERR_ARG: invalid argument of some other kind
[kw2060:20883] *** MPI_ERRORS_ARE_FATAL (processes in this
communicator will now abort,
[kw2060:20883] *** and potentially your MPI job)

-- 
Lisandro Dalcin
---------------
CIMEC (UNL/CONICET)
Predio CONICET-Santa Fe
Colectora RN 168 Km 472, Paraje El Pozo
3000 Santa Fe, Argentina
Tel: +54-342-4511594 (ext 1016)
Tel/Fax: +54-342-4511169