From cf197d5e381f2e1ee4074373399a85c6dc06f083 Mon Sep 17 00:00:00 2001 From: "Julian M. Kunkel" Date: Wed, 22 May 2019 10:21:18 +0100 Subject: [PATCH] Moved broken collectiveMetadata option into HDF5 backend module. #154 --- doc/sphinx/userDoc/options.rst | 3 +-- src/aiori-HDF5.c | 32 +++++++++++++++++++++++++++++++- src/ior.h | 2 -- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/doc/sphinx/userDoc/options.rst b/doc/sphinx/userDoc/options.rst index 8b44126..2272830 100644 --- a/doc/sphinx/userDoc/options.rst +++ b/doc/sphinx/userDoc/options.rst @@ -289,8 +289,7 @@ HDF5-ONLY * setAlignment - HDF5 alignment in bytes (e.g.: 8, 4k, 2m, 1g) [1] - * collectiveMetadata - enable HDF5 collective metadata (available since - HDF5-1.10.0) + * hdf5.collectiveMetadata - enable HDF5 collective metadata (available since HDF5-1.10.0) MPIIO-, HDF5-, AND NCMPI-ONLY ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/src/aiori-HDF5.c b/src/aiori-HDF5.c index 250f93d..ab329db 100755 --- a/src/aiori-HDF5.c +++ b/src/aiori-HDF5.c @@ -94,6 +94,34 @@ static void HDF5_Fsync(void *, IOR_param_t *); static IOR_offset_t HDF5_GetFileSize(IOR_param_t *, MPI_Comm, char *); static int HDF5_Access(const char *, int, IOR_param_t *); +/************************** O P T I O N S *****************************/ +typedef struct{ + int collective_md; +} HDF5_options_t; +/***************************** F U N C T I O N S ******************************/ + +static option_help * HDF5_options(void ** init_backend_options, void * init_values){ + HDF5_options_t * o = malloc(sizeof(HDF5_options_t)); + + if (init_values != NULL){ + memcpy(o, init_values, sizeof(HDF5_options_t)); + }else{ + /* initialize the options properly */ + o->collective_md = 0; + } + + *init_backend_options = o; + + option_help h [] = { + {0, "hdf5.collectiveMetadata", "Use collectiveMetadata (available since HDF5-1.10.0)", OPTION_FLAG, 'd', & o->collective_md}, + LAST_OPTION + }; + option_help * help = malloc(sizeof(h)); + memcpy(help, h, sizeof(h)); + return help; +} + + /************************** D E C L A R A T I O N S ***************************/ ior_aiori_t hdf5_aiori = { @@ -112,6 +140,7 @@ ior_aiori_t hdf5_aiori = { .rmdir = aiori_posix_rmdir, .access = HDF5_Access, .stat = aiori_posix_stat, + .get_options = HDF5_options }; static hid_t xferPropList; /* xfer property list */ @@ -230,7 +259,8 @@ static void *HDF5_Open(char *testFileName, IOR_param_t * param) "cannot set alignment"); #ifdef HAVE_H5PSET_ALL_COLL_METADATA_OPS - if (param->collective_md) { + HDF5_options_t *o = (HDF5_options_t*) param->backend_options; + if (o->collective_md) { /* more scalable metadata */ HDF5_CHECK(H5Pset_all_coll_metadata_ops(accessPropList, 1), diff --git a/src/ior.h b/src/ior.h index da4e5c1..5c46efe 100755 --- a/src/ior.h +++ b/src/ior.h @@ -183,8 +183,6 @@ typedef struct char* URI; /* "path" to target object */ size_t part_number; /* multi-part upload increment (PER-RANK!) */ char* UploadId; /* key for multi-part-uploads */ - int collective_md; /* use collective metatata optimization */ - /* RADOS variables */ rados_t rados_cluster; /* RADOS cluster handle */