summaryrefslogtreecommitdiffstats
path: root/src/H5FDmpio.c
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2002-04-03 04:44:26 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2002-04-03 04:44:26 (GMT)
commitad641fa7b617c8ca2ec11602cde0f72fa12696cd (patch)
tree8e08d800581c3c76c3339f50e7fc59d1b62405c8 /src/H5FDmpio.c
parentc0ca09a89965e49df0cf1a1b11f955a7d1510a0f (diff)
downloadhdf5-ad641fa7b617c8ca2ec11602cde0f72fa12696cd.zip
hdf5-ad641fa7b617c8ca2ec11602cde0f72fa12696cd.tar.gz
hdf5-ad641fa7b617c8ca2ec11602cde0f72fa12696cd.tar.bz2
[svn-r5135] Purpose:
Features. Description: Error stack used to report only hdf5 predefined error messages because it takes only static strings. Runtime defined messages were not pushed to the stack. Added the means and macros to push MPI error strings onto the hdf5 error stack. Added a new minor error class as H5E_MPIERR for this class of messages. H5Epulbic.h, H5E.c: Added H5E_MPIERR and its minor class description. H5Eprivate.h: Added HMPI_XXX macros to push MPI error strings to the stack. H5FDmpio.c: Changed couple places to use the new macros to test the new macros. A more through changes to make use of these new macros will be done later. Platforms tested: eirene (serial, parallel) modi4(parallel)
Diffstat (limited to 'src/H5FDmpio.c')
-rw-r--r--src/H5FDmpio.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c
index 0888924..d6943f6 100644
--- a/src/H5FDmpio.c
+++ b/src/H5FDmpio.c
@@ -1,5 +1,5 @@
/*
- * Copyright © 1999-2001 NCSA
+ * Copyright (c) 1999-2002 NCSA
* All rights reserved.
*
* Programmer: Robb Matzke <matzke@llnl.gov>
@@ -719,6 +719,7 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
MPI_File fh;
int mpi_amode;
int mpi_rank;
+ int mpi_code; /* mpi return code */
MPI_Offset size;
const H5FD_mpio_fapl_t *fa=NULL;
H5FD_mpio_fapl_t _fa;
@@ -788,8 +789,9 @@ H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id,
#endif
/*OKAY: CAST DISCARDS CONST*/
- if (MPI_SUCCESS != MPI_File_open(fa->comm, (char*)name, mpi_amode, fa->info, &fh))
- HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, NULL, "MPI_File_open failed");
+ if (MPI_SUCCESS !=
+ (mpi_code=MPI_File_open(fa->comm, (char*)name, mpi_amode, fa->info, &fh)))
+ HMPI_RETURN_ERROR(NULL, "MPI_File_open failed", mpi_code);
/* Following changes in handling file-truncation made be rkyates and ppweidhaas, sep 99 */
@@ -1551,9 +1553,11 @@ H5FD_mpio_flush(H5FD_t *_file)
{
H5FD_mpio_t *file = (H5FD_mpio_t*)_file;
int mpi_rank=-1;
+ int mpi_code; /* mpi return code */
uint8_t byte=0;
MPI_Status mpi_stat = {0};
MPI_Offset mpi_off;
+ herr_t ret_value=SUCCEED;
FUNC_ENTER(H5FD_mpio_flush, FAIL);
@@ -1593,15 +1597,16 @@ H5FD_mpio_flush(H5FD_t *_file)
}
- if (MPI_SUCCESS != MPI_File_sync(file->f))
- HRETURN_ERROR(H5E_INTERNAL, H5E_MPI, FAIL, "MPI_File_sync failed");
+ if (MPI_SUCCESS != (mpi_code=MPI_File_sync(file->f)))
+ HMPI_GOTO_ERROR(FAIL, "MPI_File_sync failed", mpi_code);
+done:
#ifdef H5FDmpio_DEBUG
if (H5FD_mpio_Debug[(int)'t'])
fprintf(stdout, "Leaving H5FD_mpio_flush\n" );
#endif
- FUNC_LEAVE(SUCCEED);
+ FUNC_LEAVE(ret_value);
}