diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2015-06-20 22:26:22 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2015-06-20 22:26:22 (GMT) |
commit | 6570de93dc085873f50c13be5b0361417bad3058 (patch) | |
tree | ab9559dc2f7164ec9360af388464a46bcb436228 /tools/lib/h5tools.c | |
parent | 2dfc4a7ac697419fb27eecf9aa11436e7f2c84cf (diff) | |
download | hdf5-6570de93dc085873f50c13be5b0361417bad3058.zip hdf5-6570de93dc085873f50c13be5b0361417bad3058.tar.gz hdf5-6570de93dc085873f50c13be5b0361417bad3058.tar.bz2 |
[svn-r27258] Bring revisions #27142 - #27198 from trunk to revise_chunks. h5committested.
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 14 |
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) |