[svn-r25983] HDFFV-1125: Eliminate IS_H5FD_MPI() macro use in the library and replace with driver feature flag(s).

Add an MPI atomicity feature flag and remove the macro from the library.

tested Parallel on Jam.
This commit is contained in:
Mohamad Chaarawi 2015-01-20 10:26:45 -05:00
parent 234e77b3f9
commit 1949c40bfd
6 changed files with 13 additions and 17 deletions

View File

@ -474,7 +474,7 @@ H5D__contig_collective_read(H5D_io_info_t *io_info, const H5D_type_info_t *type_
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file));
HDassert(H5FD_MPIO == H5F_DRIVER_ID(io_info->dset->oloc.file));
HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER));
/* Call generic internal collective I/O routine */
@ -521,7 +521,7 @@ H5D__contig_collective_write(H5D_io_info_t *io_info, const H5D_type_info_t *type
FUNC_ENTER_PACKAGE
/* Sanity check */
HDassert(IS_H5FD_MPIO(io_info->dset->oloc.file));
HDassert(H5FD_MPIO == H5F_DRIVER_ID(io_info->dset->oloc.file));
HDassert(TRUE == H5P_isa_class(io_info->dxpl_id, H5P_DATASET_XFER));
/* Call generic internal collective I/O routine */

View File

@ -1224,6 +1224,7 @@ H5FD_mpio_query(const H5FD_t UNUSED *_file, unsigned long *flags /* out */)
*flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */
*flags|=H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
*flags|=H5FD_FEAT_HAS_MPI; /* This driver uses MPI */
*flags|=H5FD_FEAT_HAS_MPI_ATOMICITY; /* This driver has MPI atomicity mode */
*flags|=H5FD_FEAT_ALLOCATE_EARLY; /* Allocate space early instead of late */
} /* end if */

View File

@ -40,10 +40,6 @@
/* Length of filename buffer */
#define H5FD_MAX_FILENAME_LEN 1024
/* MPI based VFDs */
#define IS_H5FD_MPIO(f) /* (H5F_t *f) */ \
(H5FD_MPIO==H5F_DRIVER_ID(f))
#ifdef H5_HAVE_PARALLEL
/* ======== Temporary data transfer properties ======== */
/* Definitions for memory MPI type property */

View File

@ -234,7 +234,12 @@ typedef enum H5F_mem_t H5FD_mem_t;
* image to store in memory.
*/
#define H5FD_FEAT_CAN_USE_FILE_IMAGE_CALLBACKS 0x00000800
/*
* Defining the H5FD_FEAT_HAS_MPI_ATOMICITY for a VFL driver means
* that the driver is able to do atomic read/write operations as
* defined by MPI atomicity semantics.
*/
#define H5FD_FEAT_HAS_MPI_ATOMICITY 0x00001000
/* Forward declaration */
typedef struct H5FD_t H5FD_t;

View File

@ -208,8 +208,8 @@ H5Fset_mpi_atomicity(hid_t file_id, hbool_t flag)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* Check VFD */
if(!IS_H5FD_MPIO(file))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, must use MPI-I/O driver")
if(!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI_ATOMICITY))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, does not support MPI atomicity mode")
/* set atomicity value */
if (H5FD_set_mpio_atomicity (file->shared->lf, flag) < 0)
@ -248,8 +248,8 @@ H5Fget_mpi_atomicity(hid_t file_id, hbool_t *flag)
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "not a file ID")
/* Check VFD */
if(!IS_H5FD_MPIO(file))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, must use MPI-I/O driver")
if(!H5F_HAS_FEATURE(file, H5FD_FEAT_HAS_MPI_ATOMICITY))
HGOTO_ERROR(H5E_FILE, H5E_BADVALUE, FAIL, "incorrect VFL driver, does not support MPI atomicity mode")
/* get atomicity value */
if (H5FD_get_mpio_atomicity (file->shared->lf, flag) < 0)

View File

@ -17,12 +17,6 @@
// Suppress message about "Constant value boolean" in TRUE macros
-emacro(506,TRUE)
// Suppress message about "Constant value boolean" in IS_H5FD_MPI* macros
-emacro(506,IS_H5FD_MPI)
// Suppress message about "Boolean within 'if' always evaluates false" in IS_H5FD_MPI* macros
-emacro((774),IS_H5FD_MPI)
// Suppress message about our use of 'goto' in our error macros
-emacro(801,HGOTO_DONE, H5Epush_goto)