diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2003-01-03 19:37:48 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2003-01-03 19:37:48 (GMT) |
commit | bd54330abfb17cd4f8ebc45203581ccc1eddf5a9 (patch) | |
tree | 557fd8ddca9ef407f2259dc55975c2788091bb05 /src/H5.c | |
parent | 8bd4ac2b3883db921a20de53130e274d7c456fd5 (diff) | |
download | hdf5-bd54330abfb17cd4f8ebc45203581ccc1eddf5a9.zip hdf5-bd54330abfb17cd4f8ebc45203581ccc1eddf5a9.tar.gz hdf5-bd54330abfb17cd4f8ebc45203581ccc1eddf5a9.tar.bz2 |
[svn-r6232] Purpose:
new feature
Description:
Added MPICH/MPE instrumentation support.
All source code are bracketed by the macro H5_HAVE_MPE.
Use "--enable-mpe" to configure it in.
Currently only worked in Eirene because the MPE library is
not installed in all machines yet.
The added file, H5MPprivate.h, holds HDF5/MPE related defintions.
Platforms tested:
Tested h5committest {arabica (fortran), eirene (fortran, C++)
modi4 (parallel, fortran)}? Yep.
Other platforms/configurations tested?
--enable-mpe feature tested in Eirene.
Diffstat (limited to 'src/H5.c')
-rw-r--r-- | src/H5.c | 40 |
1 files changed, 39 insertions, 1 deletions
@@ -45,6 +45,10 @@ H5_api_t H5_g; hbool_t H5_libinit_g = FALSE; /* Library hasn't been initialized */ #endif +#ifdef H5_HAVE_MPE +hbool_t H5_MPEinit_g = FALSE; /* MPE Library hasn't been initialized */ +#endif + char H5_lib_vers_info_g[] = H5_VERS_INFO; hbool_t dont_atexit_g = FALSE; H5_debug_t H5_debug_g; /*debugging info */ @@ -74,7 +78,6 @@ H5_init_library(void) herr_t ret_value=SUCCEED; FUNC_ENTER_NOAPI(H5_init_library, FAIL); - /* * Make sure the package information is updated. */ @@ -98,6 +101,24 @@ H5_init_library(void) H5_debug_g.pkg[H5_PKG_V].name = "v"; H5_debug_g.pkg[H5_PKG_Z].name = "z"; +#ifdef H5_HAVE_MPE + /* Initialize MPE instrumentation library. May need to move this + * up earlier if any of the above initialization involves using + * the instrumentation code. + */ + if (!H5_MPEinit_g) + { + int mpe_code; + int mpi_initialized; + MPI_Initialized(&mpi_initialized); + if (mpi_initialized){ + mpe_code = MPE_Init_log(); + assert(mpe_code >=0); + H5_MPEinit_g = TRUE; + } + } +#endif + /* * Install atexit() library cleanup routine unless the H5dont_atexit() * has been called. Once we add something to the atexit() list it stays @@ -208,6 +229,23 @@ H5_term_library(void) fprintf(stderr, " %s...\n", loop); } } + +#ifdef H5_HAVE_MPE + /* Close MPE instrumentation library. May need to move this + * down if any of the below code involves using the instrumentation code. + */ + if (H5_MPEinit_g) + { + int mpe_code; + int mpi_initialized; + MPI_Initialized(&mpi_initialized); + if (mpi_initialized){ + mpe_code = MPE_Finish_log("cpilog"); + assert(mpe_code >=0); + } + H5_MPEinit_g = FALSE; /* turn it off no matter what */ + } +#endif /* Mark library as closed */ H5_INIT_GLOBAL = FALSE; |