summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-10 19:23:09 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-06-10 19:23:09 (GMT)
commit6c4e3759f533f36f7832f1277e4f0c725e663653 (patch)
tree39b6cbb8d2d6fb61ad602bbc25f42bd89e6e9ca4 /tools
parentf2d14c76b8a8e7c09285fff9db25b101a84354b0 (diff)
parentb9f2a18b5ae9adf23cac4c0336291373a25f0721 (diff)
downloadhdf5-6c4e3759f533f36f7832f1277e4f0c725e663653.zip
hdf5-6c4e3759f533f36f7832f1277e4f0c725e663653.tar.gz
hdf5-6c4e3759f533f36f7832f1277e4f0c725e663653.tar.bz2
[svn-r27187] svn merge -r27135:27186 https://svn.hdfgroup.uiuc.edu/hdf5/trunk
Diffstat (limited to 'tools')
-rw-r--r--tools/lib/h5tools.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 10d150f..c820aff 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -54,9 +54,6 @@ unsigned long long packed_data_mask; /* mask in which packed bits to display */
/* module-scoped variables */
static int h5tools_init_g; /* if h5tools lib has been initialized */
-#ifdef H5_HAVE_PARALLEL
-static int h5tools_mpi_init_g; /* if MPI_Init() has been called */
-#endif /* H5_HAVE_PARALLEL */
/* Names of VFDs */
static const char *drivernames[]={
@@ -516,11 +513,14 @@ h5tools_get_fapl(hid_t fapl, const char *driver, unsigned *drivernum)
}
#ifdef H5_HAVE_PARALLEL
else if(!HDstrcmp(driver, drivernames[MPIO_IDX])) {
+ int mpi_initialized, mpi_finalized;
+
/* MPI-I/O Driver */
- /* check if MPI has been initialized. */
- if(!h5tools_mpi_init_g)
- MPI_Initialized(&h5tools_mpi_init_g);
- if(h5tools_mpi_init_g) {
+ /* check if MPI is available. */
+ MPI_Initialized(&mpi_initialized);
+ MPI_Finalized(&mpi_finalized);
+
+ if(mpi_initialized && !mpi_finalized) {
if(H5Pset_fapl_mpio(new_fapl, MPI_COMM_WORLD, MPI_INFO_NULL) < 0)
goto error;
if(drivernum)