summaryrefslogtreecommitdiffstats
path: root/src/H5FDmulti.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5FDmulti.c')
-rw-r--r--src/H5FDmulti.c80
1 files changed, 47 insertions, 33 deletions
diff --git a/src/H5FDmulti.c b/src/H5FDmulti.c
index 5e27c53..8ae23d2 100644
--- a/src/H5FDmulti.c
+++ b/src/H5FDmulti.c
@@ -5,12 +5,10 @@
* *
* 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. *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*
@@ -75,11 +73,11 @@ static hid_t H5FD_MULTI_g = 0;
/* Driver-specific file access properties */
typedef struct H5FD_multi_fapl_t {
- H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /*memory usage map */
- hid_t memb_fapl[H5FD_MEM_NTYPES];/*member access properties */
- char *memb_name[H5FD_MEM_NTYPES];/*name generators */
- haddr_t memb_addr[H5FD_MEM_NTYPES];/*starting addr per member */
- hbool_t relax; /*less stringent error checking */
+ H5FD_mem_t memb_map[H5FD_MEM_NTYPES]; /*memory usage map */
+ hid_t memb_fapl[H5FD_MEM_NTYPES]; /*member access properties */
+ char *memb_name[H5FD_MEM_NTYPES]; /*name generators */
+ haddr_t memb_addr[H5FD_MEM_NTYPES]; /*starting addr per member */
+ hbool_t relax; /*less stringent error checking */
} H5FD_multi_fapl_t;
/*
@@ -89,17 +87,17 @@ typedef struct H5FD_multi_fapl_t {
* copied into the parent file struct in H5F_open().
*/
typedef struct H5FD_multi_t {
- H5FD_t pub; /*public stuff, must be first */
- H5FD_multi_fapl_t fa; /*driver-specific file access properties*/
- haddr_t memb_next[H5FD_MEM_NTYPES];/*addr of next member */
- H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */
- haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files,
- *end of allocated addresses. v1.6 library
- *have the EOA for the entire file. But it's
- *meaningless for MULTI file. We replaced it
- *with the EOAs for individual files */
- unsigned flags; /*file open flags saved for debugging */
- char *name; /*name passed to H5Fopen or H5Fcreate */
+ H5FD_t pub; /*public stuff, must be first */
+ H5FD_multi_fapl_t fa; /*driver-specific file access properties */
+ haddr_t memb_next[H5FD_MEM_NTYPES]; /*addr of next member */
+ H5FD_t *memb[H5FD_MEM_NTYPES]; /*member pointers */
+ haddr_t memb_eoa[H5FD_MEM_NTYPES]; /*EOA for individual files,
+ *end of allocated addresses. v1.6 library
+ *have the EOA for the entire file. But it's
+ *meaningless for MULTI file. We replaced it
+ *with the EOAs for individual files */
+ unsigned flags; /*file open flags saved for debugging */
+ char *name; /*name passed to H5Fopen or H5Fcreate */
} H5FD_multi_t;
/* Driver specific data transfer properties */
@@ -233,9 +231,9 @@ H5FD_multi_init(void)
/* Clear the error stack */
H5Eclear2(H5E_DEFAULT);
- if (H5I_VFL!=H5Iget_type(H5FD_MULTI_g)) {
- H5FD_MULTI_g = H5FDregister(&H5FD_multi_g);
- }
+ if(H5I_VFL!=H5Iget_type(H5FD_MULTI_g))
+ H5FD_MULTI_g = H5FDregister(&H5FD_multi_g);
+
return H5FD_MULTI_g;
}
@@ -285,7 +283,8 @@ H5Pset_fapl_split(hid_t fapl, const char *meta_ext, hid_t meta_plist_id,
H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
hid_t memb_fapl[H5FD_MEM_NTYPES];
const char *memb_name[H5FD_MEM_NTYPES];
- char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN], raw_name[H5FD_MULT_MAX_FILE_NAME_LEN];
+ char meta_name[H5FD_MULT_MAX_FILE_NAME_LEN];
+ char raw_name[H5FD_MULT_MAX_FILE_NAME_LEN];
haddr_t memb_addr[H5FD_MEM_NTYPES];
/*NO TRACE*/
@@ -1111,6 +1110,7 @@ H5FD_multi_close(H5FD_t *_file)
if (file->fa.memb_fapl[mt]>=0) (void)H5Idec_ref(file->fa.memb_fapl[mt]);
if (file->fa.memb_name[mt]) free(file->fa.memb_name[mt]);
} END_MEMBERS;
+
free(file->name);
free(file);
return 0;
@@ -1149,14 +1149,18 @@ H5FD_multi_cmp(const H5FD_t *_f1, const H5FD_t *_f2)
ALL_MEMBERS(mt) {
out_mt = mt;
- if (f1->memb[mt] && f2->memb[mt]) break;
- if (!cmp) {
- if (f1->memb[mt]) cmp = -1;
- else if (f2->memb[mt]) cmp = 1;
+ if(f1->memb[mt] && f2->memb[mt])
+ break;
+ if(!cmp) {
+ if(f1->memb[mt])
+ cmp = -1;
+ else if(f2->memb[mt])
+ cmp = 1;
}
} END_MEMBERS;
assert(cmp || out_mt<H5FD_MEM_NTYPES);
- if (out_mt>=H5FD_MEM_NTYPES) return cmp;
+ if(out_mt>=H5FD_MEM_NTYPES)
+ return cmp;
return H5FDcmp(f1->memb[out_mt], f2->memb[out_mt]);
}
@@ -1186,8 +1190,10 @@ H5FD_multi_query(const H5FD_t *_f, unsigned long *flags /* out */)
/* Set the VFL feature flags that this driver supports */
if(flags) {
*flags = 0;
- *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
- *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ *flags |= H5FD_FEAT_DATA_SIEVE; /* OK to perform data sieving for faster raw data reads & writes */
+ *flags |= H5FD_FEAT_AGGREGATE_SMALLDATA; /* OK to aggregate "small" raw data allocations */
+ *flags |= H5FD_FEAT_USE_ALLOC_SIZE; /* OK just pass the allocation size to the alloc callback */
+ *flags |= H5FD_FEAT_PAGED_AGGR; /* OK special file space mapping for paged aggregation */
} /* end if */
return(0);
@@ -1532,6 +1538,14 @@ H5FD_multi_alloc(H5FD_t *_file, H5FD_mem_t type, hid_t dxpl_id, hsize_t size)
mmt = file->fa.memb_map[type];
if (H5FD_MEM_DEFAULT==mmt) mmt = type;
+ /* XXX: NEED to work on this again */
+ if(file->pub.paged_aggr) {
+ ALL_MEMBERS(mt) {
+ if(file->memb[mt])
+ file->memb[mt]->paged_aggr = file->pub.paged_aggr;
+ } END_MEMBERS;
+ }
+
if (HADDR_UNDEF==(addr=H5FDalloc(file->memb[mmt], mmt, dxpl_id, size)))
H5Epush_ret(func, H5E_ERR_CLS, H5E_INTERNAL, H5E_BADVALUE, "member file can't alloc", HADDR_UNDEF)
addr += file->fa.memb_addr[mmt];