diff options
author | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-06-10 17:57:32 (GMT) |
---|---|---|
committer | Mohamad Chaarawi <chaarawi@hdfgroup.org> | 2015-06-10 17:57:32 (GMT) |
commit | b9f2a18b5ae9adf23cac4c0336291373a25f0721 (patch) | |
tree | 0f630ce5a01721c8ac88fef5282a6f48a71c9ce8 /src/H5Eint.c | |
parent | 0f4e97907cf40af09eece68546e45cf3f3e473b2 (diff) | |
download | hdf5-b9f2a18b5ae9adf23cac4c0336291373a25f0721.zip hdf5-b9f2a18b5ae9adf23cac4c0336291373a25f0721.tar.gz hdf5-b9f2a18b5ae9adf23cac4c0336291373a25f0721.tar.bz2 |
[svn-r27185] 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 2092566..07d1e46 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 */ |