From 669b89ba0defe95e8948cb4917ed071d74932749 Mon Sep 17 00:00:00 2001 From: Neil Fortner Date: Tue, 13 Dec 2016 11:54:34 -0600 Subject: Split H5VLdaosm.h into public and private headers, to remove the need for the application to include daos.h. Fix bugs in examples. --- examples/h5dsm_dset_open.c | 2 +- examples/h5dsm_dset_read.c | 8 +++---- examples/h5dsm_dset_wpartial.c | 6 ++++- examples/h5dsm_group_open.c | 2 +- src/H5VLdaosm.h | 9 ++++---- src/H5VLdaosm_public.h | 51 ++++++++++++++++++++++++++++++++++++++++++ src/Makefile.am | 2 +- src/hdf5.h | 2 +- 8 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 src/H5VLdaosm_public.h diff --git a/examples/h5dsm_dset_open.c b/examples/h5dsm_dset_open.c index 8725b01..c7ebde9 100644 --- a/examples/h5dsm_dset_open.c +++ b/examples/h5dsm_dset_open.c @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) { } else if(H5TRget_trans_num(trans, &trans_num) < 0) - ERROR; + ERROR; printf("Opening dataset - transaction number = %llu\n", (long long unsigned)trans_num); diff --git a/examples/h5dsm_dset_read.c b/examples/h5dsm_dset_read.c index bd98b98..0fbc56f 100644 --- a/examples/h5dsm_dset_read.c +++ b/examples/h5dsm_dset_read.c @@ -32,10 +32,6 @@ int main(int argc, char *argv[]) { if((file = H5Fopen_ff(argv[2], H5F_ACC_RDONLY, fapl, argc == 4 ? &trans : NULL)) < 0) ERROR; - /* Open dataset */ - if((dset = H5Dopen_ff(file, argv[3], H5P_DEFAULT, trans)) < 0) - ERROR; - /* Create transaction if specified */ if(argc == 5) { trans_num = (uint64_t)atoi(argv[4]); @@ -44,6 +40,10 @@ int main(int argc, char *argv[]) { } else if(H5TRget_trans_num(trans, &trans_num) < 0) + ERROR; + + /* Open dataset */ + if((dset = H5Dopen_ff(file, argv[3], H5P_DEFAULT, trans)) < 0) ERROR; printf("Reading dataset - transaction number = %llu\n", (long long unsigned)trans_num); diff --git a/examples/h5dsm_dset_wpartial.c b/examples/h5dsm_dset_wpartial.c index 8d08d60..d6ede96 100644 --- a/examples/h5dsm_dset_wpartial.c +++ b/examples/h5dsm_dset_wpartial.c @@ -75,7 +75,11 @@ int main(int argc, char *argv[]) { printf("\n"); } - printf("Transaction number = %llu\n", (long long unsigned)(trans_num + 1)); + if(rank == 0) + MPI_Barrier(MPI_COMM_WORLD); + else + printf("Transaction number = %llu\n", (long long unsigned)(trans_num + 1)); + /* Set up dataspaces */ if((file_space = H5Screate_simple(2, dims, NULL)) < 0) diff --git a/examples/h5dsm_group_open.c b/examples/h5dsm_group_open.c index 6dc4144..9ec9af7 100644 --- a/examples/h5dsm_group_open.c +++ b/examples/h5dsm_group_open.c @@ -35,7 +35,7 @@ int main(int argc, char *argv[]) { } else if(H5TRget_trans_num(trans, &trans_num) < 0) - ERROR; + ERROR; printf("Opening group - transaction number = %llu\n", (long long unsigned)trans_num); diff --git a/src/H5VLdaosm.h b/src/H5VLdaosm.h index 622b7ad..6e3c49c 100644 --- a/src/H5VLdaosm.h +++ b/src/H5VLdaosm.h @@ -17,13 +17,16 @@ * Programmer: Neil Fortner * September, 2016 * - * Purpose: The public header file for the DAOS-M VOL plugin. + * Purpose: The private header file for the DAOS-M VOL plugin. */ #ifndef H5VLdaosm_H #define H5VLdaosm_H #define H5_HAVE_EFF 1 /* DSMINC */ +/* Include package's public header */ +#include "H5VLdaosm_public.h" + #ifdef H5_HAVE_EFF #include "daos.h" @@ -92,10 +95,6 @@ typedef struct H5VL_daosm_dset_t { extern hid_t H5VL_DAOSM_g; H5_DLL hid_t H5VL_daosm_init(void); -H5_DLL herr_t H5Pset_fapl_daosm(hid_t fapl_id, MPI_Comm comm, MPI_Info info, - uuid_t pool_uuid, char *pool_grp); -//H5_DLL herr_t EFF_init(void); DSMINC -//H5_DLL herr_t EFF_finalize(void); DSMINC #endif /* H5_HAVE_EFF */ diff --git a/src/H5VLdaosm_public.h b/src/H5VLdaosm_public.h new file mode 100644 index 0000000..eeb0d7e --- /dev/null +++ b/src/H5VLdaosm_public.h @@ -0,0 +1,51 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by The HDF Group. * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from help@hdfgroup.org. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/* + * Programmer: Neil Fortner + * December, 2016 + * + * Purpose: The public header file for the DAOS-M VOL plugin. + */ +#ifndef H5VLdaosm_public_H +#define H5VLdaosm_public_H + +#define H5_HAVE_EFF 1 /* DSMINC */ + +/* System headers needed by this file */ +#include + +/* Public headers needed by this file */ +#include "H5public.h" +#include "H5Ipublic.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef H5_HAVE_EFF + +H5_DLL herr_t H5Pset_fapl_daosm(hid_t fapl_id, MPI_Comm comm, MPI_Info info, + uuid_t pool_uuid, char *pool_grp); +//H5_DLL herr_t EFF_init(void); DSMINC +//H5_DLL herr_t EFF_finalize(void); DSMINC + +#endif /* H5_HAVE_EFF */ + +#ifdef __cplusplus +} +#endif + +#endif /* H5VLdaosm_H */ diff --git a/src/Makefile.am b/src/Makefile.am index deff08f..79850ae 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -135,7 +135,7 @@ include_HEADERS = hdf5.h H5api_adpt.h H5overflow.h H5pubconf.h H5public.h H5vers H5FDmulti.h H5FDsec2.h H5FDstdio.h \ H5FFpublic.h \ H5VLpublic.h H5VLnative.h \ - H5VLdaosm.h \ + H5VLdaosm_public.h \ H5Gpublic.h H5Ipublic.h H5Lpublic.h \ H5MMpublic.h H5Opublic.h H5Ppublic.h \ H5PLextern.h H5PLpublic.h \ diff --git a/src/hdf5.h b/src/hdf5.h index b7580bc..7d3e74b 100644 --- a/src/hdf5.h +++ b/src/hdf5.h @@ -44,7 +44,7 @@ /* FastForward headers */ #include "H5FFpublic.h" /* FastForward wrappers */ #include "H5TRpublic.h" /* Transactions */ -#include "H5VLdaosm.h" /* DAOS-M VOL plugin */ +#include "H5VLdaosm_public.h" /* DAOS-M VOL plugin */ /* Predefined VOL plugins */ #include "H5VLnative.h" /* Native HDF5 plugin */ -- cgit v0.12