From 20f5e2cc1b20ff43bcc38de67b2c30d87cc1f005 Mon Sep 17 00:00:00 2001 From: Robb Matzke Date: Fri, 9 Aug 2002 09:55:36 -0500 Subject: [svn-r5861] ./hdf5-devel/src/H5FDmpiposix.c Purpose: Merged from 1.4 branch Description: API tracing improvements Platforms tested: Linux (--disable-hsizet didn't work before my changes and still doesn't work, but --enable-hsizet is fine). Note: This checkin includes temporary code in H5FDmpiposix.c to turn off GPFS byte range token prefetches on ASCI/Blue. Once the HDF5 API supports the necessary prerequisite functionality this temporary code can be migraged up above HDF5. --- src/H5FDmpiposix.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 117fea7..e7c5284 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -41,6 +41,10 @@ #include "H5MMprivate.h" /*memory allocation */ #include "H5Pprivate.h" /*property lists */ +#ifdef USE_GPFS_HINTS +# include +#endif + /* * The driver identification number, initialized at runtime if H5_HAVE_PARALLEL * is defined. This allows applications to still have the H5FD_MPIPOSIX @@ -604,6 +608,37 @@ H5FD_mpiposix_open(const char *name, unsigned flags, hid_t fapl_id, if (MPI_SUCCESS != (mpi_code= MPI_Bcast(&sb, sizeof(h5_stat_t), MPI_BYTE, 0, fa->comm))) HMPI_GOTO_ERROR(NULL, "MPI_Bcast failed", mpi_code); +#ifdef USE_GPFS_HINTS + /* Prevent GPFS from prefetching byte range (BR) tokens */ + { + struct { + gpfsFcntlHeader_t hdr; + gpfsFreeRange_t fr; + gpfsMultipleAccessRange_t mar; + } hint; + memset(&hint, 0, sizeof hint); + hint.hdr.totalLength = sizeof hint; + hint.hdr.fcntlVersion = GPFS_FCNTL_CURRENT_VERSION; + hint.fr.structLen = sizeof hint.fr; + hint.fr.structType = GPFS_FREE_RANGE; + hint.fr.start = 0; + hint.fr.length = 0; + hint.mar.structLen = sizeof hint.mar; + hint.mar.structType = GPFS_MULTIPLE_ACCESS_RANGE; + hint.mar.accRangeCnt = 1; + hint.mar.accRangeArray[0].blockNumber = 1 + mpi_rank; + hint.mar.accRangeArray[0].start = 0; + hint.mar.accRangeArray[0].length = sb.st_blksize; + hint.mar.accRangeArray[0].isWrite = true; + + if (gpfs_fcntl(f->fd, &hint)<0) + HGOTO_ERROR(H5E_FILE, H5E_FCNTL, NULL, "failed to send hints to GPFS"); + + if (0==mpi_rank) + fprintf(stderr, "HDF5: using GPFS hint mechanism...\n"); + } +#endif + /* Build the file struct and initialize it */ if (NULL==(file=H5MM_calloc(sizeof(H5FD_mpiposix_t)))) HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, NULL, "memory allocation failed"); -- cgit v0.12