From 1ec946fac8375b9b5a377c5deb027ed17f364255 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Thu, 31 Aug 2000 14:33:58 -0500 Subject: [svn-r2498] Added new VFL 'query' code and added new 'type of data' parameter to write call. --- src/H5FDcore.c | 5 +++-- src/H5FDdpss.c | 5 +++-- src/H5FDfamily.c | 43 ++++++++++++++++++++++++++++++++++++++++--- src/H5FDgass.c | 5 +++-- src/H5FDmpio.c | 40 ++++++++++++++++++++++++++++++++++++++-- src/H5FDmulti.c | 7 ++++--- src/H5FDsec2.c | 47 ++++++++++++++++++++++++++++++++++++++++++----- src/H5FDsrb.c | 5 +++-- src/H5FDstdio.c | 38 ++++++++++++++++++++++++++++++++++++-- 9 files changed, 172 insertions(+), 23 deletions(-) diff --git a/src/H5FDcore.c b/src/H5FDcore.c index 5686003..24711af 100644 --- a/src/H5FDcore.c +++ b/src/H5FDcore.c @@ -84,7 +84,7 @@ static herr_t H5FD_core_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_core_get_eof(H5FD_t *_file); static herr_t H5FD_core_read(H5FD_t *_file, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_core_write(H5FD_t *_file, hid_t fapl_id, haddr_t addr, +static herr_t H5FD_core_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, hsize_t size, const void *buf); static const H5FD_class_t H5FD_core_g = { @@ -103,6 +103,7 @@ static const H5FD_class_t H5FD_core_g = { H5FD_core_open, /*open */ H5FD_core_close, /*close */ H5FD_core_cmp, /*cmp */ + NULL, /*query */ NULL, /*alloc */ NULL, /*free */ H5FD_core_get_eoa, /*get_eoa */ @@ -625,7 +626,7 @@ H5FD_core_read(H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -H5FD_core_write(H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_core_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, hsize_t size, const void *buf) { H5FD_core_t *file = (H5FD_core_t*)_file; diff --git a/src/H5FDdpss.c b/src/H5FDdpss.c index 67e43e3..7a03ffe 100644 --- a/src/H5FDdpss.c +++ b/src/H5FDdpss.c @@ -119,7 +119,7 @@ static herr_t H5FD_dpss_set_eoa (H5FD_t *_file, haddr_t addr); static haddr_t H5FD_dpss_get_eof (H5FD_t *_file); static herr_t H5FD_dpss_read (H5FD_t *_file, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_dpss_write (H5FD_t *_file, hid_t UNUSED fapl_id,haddr_t addr, +static herr_t H5FD_dpss_write (H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED fapl_id,haddr_t addr, hsize_t size, const void *buf); /* The Grid Storage I/O driver information */ @@ -139,6 +139,7 @@ static const H5FD_class_t H5FD_dpss_g = { H5FD_dpss_open, /* open */ H5FD_dpss_close, /* close */ NULL, /* cmp */ + NULL, /*query */ NULL, /* alloc */ NULL, /* free */ H5FD_dpss_get_eoa, /* get_eoa */ @@ -581,7 +582,7 @@ H5FD_dpss_read (H5FD_t *_file, hid_t dxpl_id, haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -H5FD_dpss_write (H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_dpss_write (H5FD_t *_file, H5FD_mem_t type, hid_t UNUSED dxpl_id, haddr_t addr, hsize_t size, const void *buf) { H5FD_dpss_t *file = (H5FD_dpss_t *) _file; diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c index a6a5548..fdb0ac5 100644 --- a/src/H5FDfamily.c +++ b/src/H5FDfamily.c @@ -71,12 +71,13 @@ static H5FD_t *H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD_family_close(H5FD_t *_file); static int H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD_family_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_family_get_eoa(H5FD_t *_file); static herr_t H5FD_family_set_eoa(H5FD_t *_file, haddr_t eoa); static haddr_t H5FD_family_get_eof(H5FD_t *_file); static herr_t H5FD_family_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, void *_buf/*out*/); -static herr_t H5FD_family_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, +static herr_t H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size, const void *_buf); static herr_t H5FD_family_flush(H5FD_t *_file); @@ -97,6 +98,7 @@ static const H5FD_class_t H5FD_family_g = { H5FD_family_open, /*open */ H5FD_family_close, /*close */ H5FD_family_cmp, /*cmp */ + H5FD_family_query, /*query */ NULL, /*alloc */ NULL, /*free */ H5FD_family_get_eoa, /*get_eoa */ @@ -608,6 +610,41 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /*------------------------------------------------------------------------- + * Function: H5FD_family_query + * + * Purpose: Set the flags that this VFL driver is capable of supporting. + * (listed in H5FDpublic.h) + * + * Return: Success: non-negative + * + * Failure: negative + * + * Programmer: Quincey Koziol + * Friday, August 25, 2000 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD_family_query(const H5FD_t *_f, unsigned long *flags /* out */) +{ + const H5FD_family_t *f = (const H5FD_family_t*)_f; + herr_t ret_value=SUCCEED; + + FUNC_ENTER(H5FD_family_query, FAIL); + + /* Set the VFL feature flags that this driver supports */ + if(flags) { + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + } /* end if */ + + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- * Function: H5FD_family_get_eoa * * Purpose: Returns the end-of-address marker for the file. The EOA @@ -837,7 +874,7 @@ H5FD_family_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, *------------------------------------------------------------------------- */ static herr_t -H5FD_family_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, +H5FD_family_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size, const void *_buf) { H5FD_family_t *file = (H5FD_family_t*)_file; @@ -868,7 +905,7 @@ H5FD_family_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, req = MIN(size, file->memb_size-sub); assert(inmembs); - if (H5FDwrite(file->memb[i], memb_dxpl_id, sub, req, buf)<0) + if (H5FDwrite(file->memb[i], type, memb_dxpl_id, sub, req, buf)<0) HRETURN_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "member file write failed"); diff --git a/src/H5FDgass.c b/src/H5FDgass.c index bafbd2e..e500d8e 100644 --- a/src/H5FDgass.c +++ b/src/H5FDgass.c @@ -105,7 +105,7 @@ static herr_t H5FD_gass_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_gass_get_eof(H5FD_t *_file); static herr_t H5FD_gass_read(H5FD_t *_file, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_gass_write(H5FD_t *_file, hid_t fapl_id, haddr_t addr, +static herr_t H5FD_gass_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, hsize_t size, const void *buf); /* GASS I/O-specific file access properties */ @@ -129,6 +129,7 @@ static const H5FD_class_t H5FD_gass_g = { NULL, /*dxpl_free */ H5FD_gass_open, /*open */ H5FD_gass_close, /*close */ + NULL, /*query */ NULL, /*cmp */ NULL, /*alloc */ NULL, /*free */ @@ -616,7 +617,7 @@ H5FD_gass_read(H5FD_t *_file, hid_t dxpl_id/*unused*/, haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -H5FD_gass_write(H5FD_t *_file, hid_t dxpl_id/*unused*/, haddr_t addr, +H5FD_gass_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id/*unused*/, haddr_t addr, hsize_t size, const void *buf) { H5FD_gass_t *file = (H5FD_gass_t*)_file; diff --git a/src/H5FDmpio.c b/src/H5FDmpio.c index 89dd768..cdbedc1 100644 --- a/src/H5FDmpio.c +++ b/src/H5FDmpio.c @@ -71,12 +71,13 @@ static void *H5FD_mpio_fapl_get(H5FD_t *_file); static H5FD_t *H5FD_mpio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD_mpio_close(H5FD_t *_file); +static herr_t H5FD_mpio_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_mpio_get_eoa(H5FD_t *_file); static herr_t H5FD_mpio_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_mpio_get_eof(H5FD_t *_file); static herr_t H5FD_mpio_read(H5FD_t *_file, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_mpio_write(H5FD_t *_file, hid_t fapl_id, haddr_t addr, +static herr_t H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, hsize_t size, const void *buf); static herr_t H5FD_mpio_flush(H5FD_t *_file); @@ -103,6 +104,7 @@ static const H5FD_class_t H5FD_mpio_g = { H5FD_mpio_open, /*open */ H5FD_mpio_close, /*close */ NULL, /*cmp */ + H5FD_mpio_query, /*query */ NULL, /*alloc */ NULL, /*free */ H5FD_mpio_get_eoa, /*get_eoa */ @@ -857,6 +859,40 @@ H5FD_mpio_close(H5FD_t *_file) /*------------------------------------------------------------------------- + * Function: H5FD_mpio_query + * + * Purpose: Set the flags that this VFL driver is capable of supporting. + * (listed in H5FDpublic.h) + * + * Return: Success: non-negative + * + * Failure: negative + * + * Programmer: Quincey Koziol + * Friday, August 25, 2000 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD_mpio_query(const H5FD_t *_f, unsigned long *flags /* out */) +{ + const H5FD_mpio_t *f = (const H5FD_mpio_t*)_f; + herr_t ret_value=SUCCEED; + + FUNC_ENTER(H5FD_mpio_query, FAIL); + + /* Set the VFL feature flags that this driver supports */ + if(flags) { + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + } /* end if */ + + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- * Function: H5FD_mpio_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker @@ -1231,7 +1267,7 @@ H5FD_mpio_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, *------------------------------------------------------------------------- */ static herr_t -H5FD_mpio_write(H5FD_t *_file, hid_t dxpl_id/*unused*/, haddr_t addr, +H5FD_mpio_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t dxpl_id/*unused*/, haddr_t addr, hsize_t size, const void *buf) { H5FD_mpio_t *file = (H5FD_mpio_t*)_file; diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c index 276db2c..b77a695 100644 --- a/src/H5FDmulti.c +++ b/src/H5FDmulti.c @@ -123,7 +123,7 @@ static herr_t H5FD_multi_free(H5FD_t *_file, H5FD_mem_t type, haddr_t addr, hsize_t size); static herr_t H5FD_multi_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, void *_buf/*out*/); -static herr_t H5FD_multi_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, +static herr_t H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size, const void *_buf); static herr_t H5FD_multi_flush(H5FD_t *_file); @@ -144,6 +144,7 @@ static const H5FD_class_t H5FD_multi_g = { H5FD_multi_open, /*open */ H5FD_multi_close, /*close */ H5FD_multi_cmp, /*cmp */ + NULL, /*query */ H5FD_multi_alloc, /*alloc */ H5FD_multi_free, /*free */ H5FD_multi_get_eoa, /*get_eoa */ @@ -1587,7 +1588,7 @@ H5FD_multi_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, *------------------------------------------------------------------------- */ static herr_t -H5FD_multi_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, +H5FD_multi_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size, const void *_buf) { H5FD_multi_t *file = (H5FD_multi_t*)_file; @@ -1618,7 +1619,7 @@ H5FD_multi_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, assert(hi>0); /* Write to that member */ - return H5FDwrite(file->memb[hi], dx?dx->memb_dxpl[hi]:H5P_DEFAULT, + return H5FDwrite(file->memb[hi], type, dx?dx->memb_dxpl[hi]:H5P_DEFAULT, addr-start_addr, size, _buf); } diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c index 7d0a9cf..7e66f39 100644 --- a/src/H5FDsec2.c +++ b/src/H5FDsec2.c @@ -122,12 +122,13 @@ static H5FD_t *H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD_sec2_close(H5FD_t *_file); static int H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD_sec2_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_sec2_get_eoa(H5FD_t *_file); static herr_t H5FD_sec2_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_sec2_get_eof(H5FD_t *_file); static herr_t H5FD_sec2_read(H5FD_t *_file, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_sec2_write(H5FD_t *_file, hid_t fapl_id, haddr_t addr, +static herr_t H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, hsize_t size, const void *buf); static herr_t H5FD_sec2_flush(H5FD_t *_file); @@ -144,9 +145,10 @@ static const H5FD_class_t H5FD_sec2_g = { 0, /*dxpl_size */ NULL, /*dxpl_copy */ NULL, /*dxpl_free */ - H5FD_sec2_open, /*open */ - H5FD_sec2_close, /*close */ - H5FD_sec2_cmp, /*cmp */ + H5FD_sec2_open, /*open */ + H5FD_sec2_close, /*close */ + H5FD_sec2_cmp, /*cmp */ + H5FD_sec2_query, /*query */ NULL, /*alloc */ NULL, /*free */ H5FD_sec2_get_eoa, /*get_eoa */ @@ -387,6 +389,41 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /*------------------------------------------------------------------------- + * Function: H5FD_sec2_query + * + * Purpose: Set the flags that this VFL driver is capable of supporting. + * (listed in H5FDpublic.h) + * + * Return: Success: non-negative + * + * Failure: negative + * + * Programmer: Quincey Koziol + * Friday, August 25, 2000 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD_sec2_query(const H5FD_t *_f, unsigned long *flags /* out */) +{ + const H5FD_sec2_t *f = (const H5FD_sec2_t*)_f; + herr_t ret_value=SUCCEED; + + FUNC_ENTER(H5FD_sec2_query, FAIL); + + /* Set the VFL feature flags that this driver supports */ + if(flags) { + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + } /* end if */ + + FUNC_LEAVE(ret_value); +} + + +/*------------------------------------------------------------------------- * Function: H5FD_sec2_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker @@ -577,7 +614,7 @@ H5FD_sec2_read(H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -H5FD_sec2_write(H5FD_t *_file, hid_t UNUSED dxpl_id, haddr_t addr, +H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, haddr_t addr, hsize_t size, const void *buf) { H5FD_sec2_t *file = (H5FD_sec2_t*)_file; diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c index 51a2fd3..af75b1e 100644 --- a/src/H5FDsrb.c +++ b/src/H5FDsrb.c @@ -61,7 +61,7 @@ static herr_t H5FD_srb_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_srb_get_eof(H5FD_t *_file); static herr_t H5FD_srb_read(H5FD_t *_file, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_srb_write(H5FD_t *_file, hid_t fapl_id, haddr_t addr, +static herr_t H5FD_srb_write(H5FD_t *_file, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, hsize_t size, const void *buf); static herr_t H5FD_srb_flush(H5FD_t *_file); @@ -99,6 +99,7 @@ static const H5FD_class_t H5FD_srb_g = { H5FD_srb_open, /*open */ H5FD_srb_close, /*close */ NULL, /*cmp */ + NULL, /*query */ NULL, /*alloc */ NULL, /*free */ H5FD_srb_get_eoa, /*get_eoa */ @@ -521,7 +522,7 @@ H5FD_srb_read(H5FD_t *_file, hid_t dxpl_id/*unused*/, haddr_t addr, *------------------------------------------------------------------------- */ static herr_t -H5FD_srb_write(H5FD_t *_file, hid_t dxpl_id/*unused*/, haddr_t addr, +H5FD_srb_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id/*unused*/, haddr_t addr, hsize_t size, const void *buf) { H5FD_srb_t *file = (H5FD_srb_t*)_file; diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index 1c42900..62dc93c 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -111,12 +111,13 @@ static H5FD_t *H5FD_stdio_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr); static herr_t H5FD_stdio_close(H5FD_t *lf); static int H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2); +static herr_t H5FD_stdio_query(const H5FD_t *_f1, unsigned long *flags); static haddr_t H5FD_stdio_get_eoa(H5FD_t *_file); static herr_t H5FD_stdio_set_eoa(H5FD_t *_file, haddr_t addr); static haddr_t H5FD_stdio_get_eof(H5FD_t *_file); static herr_t H5FD_stdio_read(H5FD_t *lf, hid_t fapl_id, haddr_t addr, hsize_t size, void *buf); -static herr_t H5FD_stdio_write(H5FD_t *lf, hid_t fapl_id, haddr_t addr, +static herr_t H5FD_stdio_write(H5FD_t *lf, H5FD_mem_t type, hid_t fapl_id, haddr_t addr, hsize_t size, const void *buf); static herr_t H5FD_stdio_flush(H5FD_t *_file); @@ -136,6 +137,7 @@ static const H5FD_class_t H5FD_stdio_g = { H5FD_stdio_open, /*open */ H5FD_stdio_close, /*close */ H5FD_stdio_cmp, /*cmp */ + H5FD_stdio_query, /*query */ NULL, /*alloc */ NULL, /*free */ H5FD_stdio_get_eoa, /*get_eoa */ @@ -409,6 +411,38 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2) /*------------------------------------------------------------------------- + * Function: H5FD_stdio_query + * + * Purpose: Set the flags that this VFL driver is capable of supporting. + * (listed in H5FDpublic.h) + * + * Return: Success: non-negative + * + * Failure: negative + * + * Programmer: Quincey Koziol + * Friday, August 25, 2000 + * + * Modifications: + * + *------------------------------------------------------------------------- + */ +static herr_t +H5FD_stdio_query(const H5FD_t *_f, unsigned long *flags /* out */) +{ + const H5FD_stdio_t *f = (const H5FD_stdio_t*)_f; + + /* Set the VFL feature flags that this driver supports */ + if(flags) { + *flags|=H5FD_FEAT_AGGREGATE_METADATA; /* OK to aggregate metadata allocations */ + *flags|=H5FD_FEAT_ACCUMULATE_METADATA; /* OK to accumulate metadata for faster writes */ + } /* end if */ + + return(0); +} + + +/*------------------------------------------------------------------------- * Function: H5FD_stdio_get_eoa * * Purpose: Gets the end-of-address marker for the file. The EOA marker @@ -628,7 +662,7 @@ H5FD_stdio_read(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, hsize_t size, *------------------------------------------------------------------------- */ static herr_t -H5FD_stdio_write(H5FD_t *_file, hid_t dxpl_id, haddr_t addr, +H5FD_stdio_write(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, haddr_t addr, hsize_t size, const void *buf) { H5FD_stdio_t *file = (H5FD_stdio_t*)_file; -- cgit v0.12