diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-06-11 19:08:49 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-06-11 19:08:49 (GMT) |
commit | 3e3f88cfa4a04d94288d0ef7904500b1ef966333 (patch) | |
tree | be73c0ca26a7ffc252fc5da4283aabd992229678 /src/H5Eint.c | |
parent | 849555ef99170b02151eb72cf14d0ce7e0cc5a22 (diff) | |
download | hdf5-3e3f88cfa4a04d94288d0ef7904500b1ef966333.zip hdf5-3e3f88cfa4a04d94288d0ef7904500b1ef966333.tar.gz hdf5-3e3f88cfa4a04d94288d0ef7904500b1ef966333.tar.bz2 |
[svn-r27190] merge 27185 from trunk:
- fix more instances where both mpi is_initialized and is_finalized need to be checked before making any MPI calls.
tested with h5committest.
Diffstat (limited to 'src/H5Eint.c')
-rw-r--r-- | src/H5Eint.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Eint.c b/src/H5Eint.c index 0dab65c..252972f 100644 --- a/src/H5Eint.c +++ b/src/H5Eint.c @@ -272,10 +272,12 @@ H5E_walk1_cb(int n, H5E_error1_t *err_desc, void *client_data) /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { - int mpi_rank, mpi_initialized; + int mpi_rank, mpi_initialized, mpi_finalized; MPI_Initialized(&mpi_initialized); - if(mpi_initialized) { + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); fprintf(stream, "MPI-process %d", mpi_rank); } /* end if */ @@ -402,10 +404,12 @@ H5E_walk2_cb(unsigned n, const H5E_error2_t *err_desc, void *client_data) /* try show the process or thread id in multiple processes cases*/ #ifdef H5_HAVE_PARALLEL { - int mpi_rank, mpi_initialized; + int mpi_rank, mpi_initialized, mpi_finalized; MPI_Initialized(&mpi_initialized); - if(mpi_initialized) { + MPI_Finalized(&mpi_finalized); + + if(mpi_initialized && !mpi_finalized) { MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); fprintf(stream, "MPI-process %d", mpi_rank); } /* end if */ |