Commit b3edcb53 authored by Rob Latham's avatar Rob Latham
Browse files

proper return value for MPI_File_call_errhandler



Lisandro Dalcin found we returned the wrong value from
MPI_File_call_errhandler.  it should return MPI_SUCCESS unless something
goes wrong with MPI_File_call_errhandler itself.

Closes #2259
Signed-off-by: default avatarJunchao Zhang <jczhang@mcs.anl.gov>
parent 64b77563
......@@ -95,7 +95,6 @@ int MPI_File_call_errhandler(MPI_File fh, int errorcode)
not integers. */
if (e->handle == MPI_ERRORS_RETURN) {
mpi_errno = errorcode;
goto fn_exit;
}
......
......@@ -20,6 +20,7 @@ noinst_PROGRAMS = \
errfatal \
predef_eh \
errstring2 \
file_errhdl \
dynamic_errcode_predefined_errclass
EXTRA_PROGRAMS = errcode errring errstring
......
/* test case contributed by Lisandro Dalcin <dalcinl@gmail.com> */
#include <mpi.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
int ierr;
MPI_File fh;
MPI_Init(&argc, &argv);
MPI_File_open(MPI_COMM_WORLD,"/tmp/datafile",
MPI_MODE_CREATE|MPI_MODE_RDWR|MPI_MODE_DELETE_ON_CLOSE,
MPI_INFO_NULL,&fh);
MPI_File_set_errhandler(fh,MPI_ERRORS_RETURN);
ierr = MPI_File_call_errhandler(fh,MPI_ERR_FILE);
if (ierr != MPI_SUCCESS) {
fprintf(stderr, "ierr: %d, expected: %d\n", ierr, (int)MPI_SUCCESS);
} else {
printf(" No Errors\n");
}
MPI_File_close(&fh);
MPI_Finalize();
return 0;
}
......@@ -5,3 +5,4 @@ predef_eh 1
predef_eh 2
errstring2 1
dynamic_errcode_predefined_errclass 1
file_errhdl 1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment