[svn-r2498] Added new VFL 'query' code and added new 'type of data' parameter to write

call.
This commit is contained in:
Quincey Koziol 2000-08-31 14:33:58 -05:00
parent 362baf1299
commit 1ec946fac8
9 changed files with 172 additions and 23 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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 */
@ -606,6 +608,41 @@ H5FD_family_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
FUNC_LEAVE(ret_value);
}
/*-------------------------------------------------------------------------
* 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
@ -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(i<file->nmembs);
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");

View File

@ -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;

View File

@ -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 */
@ -855,6 +857,40 @@ H5FD_mpio_close(H5FD_t *_file)
FUNC_LEAVE(SUCCEED);
}
/*-------------------------------------------------------------------------
* 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
@ -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;

View File

@ -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);
}

View File

@ -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 */
@ -385,6 +387,41 @@ H5FD_sec2_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
FUNC_LEAVE(ret_value);
}
/*-------------------------------------------------------------------------
* 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
@ -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;

View File

@ -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;

View File

@ -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 */
@ -407,6 +409,38 @@ H5FD_stdio_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
return 0;
}
/*-------------------------------------------------------------------------
* 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
@ -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;