From 1949c40bfddf4bea44345e0cd00baae94597f23a Mon Sep 17 00:00:00 2001 From: Mohamad Chaarawi Date: Tue, 20 Jan 2015 10:26:45 -0500 Subject: [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. --- src/H5Dmpio.c | 4 ++-- src/H5FDmpio.c | 1 + src/H5FDprivate.h | 4 ---- src/H5FDpublic.h | 7 ++++++- src/H5Fmpi.c | 8 ++++---- src/hdf5.lnt | 6 ------ 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/H5Dmpio.c b/src/H5Dmpio.c index 88c6075..58bcc04 100644 --- a/src/H5Dmpio.c +++ b/src/H5Dmpio.c @@ -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 */ diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 70cf49a..04ae5da 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -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 */ diff --git a/src/H5FDprivate.h b/src/H5FDprivate.h index 7c2a564..e98f0f4 100644 --- a/src/H5FDprivate.h +++ b/src/H5FDprivate.h @@ -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 */ diff --git a/src/H5FDpublic.h b/src/H5FDpublic.h index 87edf50..452de02 100644 --- a/src/H5FDpublic.h +++ b/src/H5FDpublic.h @@ -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; diff --git a/src/H5Fmpi.c b/src/H5Fmpi.c index 4d3ca34..cfb6f3c 100644 --- a/src/H5Fmpi.c +++ b/src/H5Fmpi.c @@ -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) diff --git a/src/hdf5.lnt b/src/hdf5.lnt index 2ccc1f5..642698a 100644 --- a/src/hdf5.lnt +++ b/src/hdf5.lnt @@ -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) -- cgit v0.12