summaryrefslogtreecommitdiffstats
path: root/test/h5test.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1999-08-17 19:12:59 (GMT)
committerRobb Matzke <matzke@llnl.gov>1999-08-17 19:12:59 (GMT)
commitcc89b8a605dfc7370cb760e6c3d7339cbf1e9884 (patch)
tree82e0552ea6a80a2e362fdc77960a3483648aae75 /test/h5test.c
parent5ef0237e2fe5ac6aee0d97fdc6bcf22f72d47162 (diff)
downloadhdf5-cc89b8a605dfc7370cb760e6c3d7339cbf1e9884.zip
hdf5-cc89b8a605dfc7370cb760e6c3d7339cbf1e9884.tar.gz
hdf5-cc89b8a605dfc7370cb760e6c3d7339cbf1e9884.tar.bz2
[svn-r1572] Changes since 19990810
---------------------- ./MANIFEST ./src/H5FDmulti.c [NEW] ./src/H5FDmulti.h [NEW] ./src/Makefile.in ./src/hdf5.h The split driver was reimplemented as a more general "multi" driver which is capable of splitting data into multiple files like the family driver except the partioning is done by memory usage type instead of address. The H5Pset_fapl_split() function just calls H5Pset_fapl_multi() with arguments which prepare to split the address space into two files: meta and raw data. This is the first version. I plan to allow the open() call to relax a bit which would allow one to open an hdf5 file when only the meta-data file is present. This would allow a very large file to be split and stored on tape and the relatively small meta file to be mirrored on disk to allow limited browsing of the file (any request for raw data would fail). ./src/H5private.h ./src/H5F.c ./src/H5FD.c ./src/H5FDprivate.h ./src/H5FDpublic.h ./src/H5FDcore.c ./src/H5FDfamily.c ./src/H5FDmpio.c ./src/H5FDsec2.c Added the ability for a file driver to store information in the superblock which would be needed if the file were opened again later for reading. The format is driver-defined which allows users to extend it however they like. ./doc/html/H5.format.html Added information about the new driver information block of the superblock. This is where file drivers store information they need in order to reopen the file later. ./src/H5F.c ./src/H5Fprivate.h ./src/H5FD.c ./src/H5FDprivate.h ./src/H5FDpublic.h ./src/H5FDcore.c ./src/H5FDfamily.c ./src/H5FDmpio.c ./src/H5FDsec2.c ./src/H5Fistore.c ./src/H5R.c The file access properties and the file access property list were decoupled, which allows the property list to more cleanly contain properties for various levels of the file and which allows the property list to be modified more cleanly when opening files. ./src/H5.c ./src/H5FDpublic.h Removed H5FD_MEM_META and H5FD_MEM_GROUP since they're never used. ./src/H5D.c Changed the way we detect the MPIO driver in all these special cases. ./src/H5F.c ./src/H5Rpublic.h ./test/tfile.c The default file sizeof(offset) was changed to be a function of haddr_t instead of hsize_t. THE H5RPUBLIC.H DEFINITIONS WILL HAVE PROBLEMS IF THE USER CREATES A FILE WITH NON-DEFAULT OFFSET AND SIZE SIZES! ./src/H5F.c Fixed an uninitialized memory access bug in file closing related to the VFL. ./src/H5T.c ./src/H5Tpublic.h Added an H5T_NATIVE_HADDR predefined datatype which corresponds to the `haddr_t' type. ./test/Makefile.in Reformatted long lines. ./test/big.c ./test/cmpd_dset.c ./test/dsets.c ./test/dtypes.c ./test/extend.c ./test/external.c Removed the H5F_ACC_DEBUG flag from file creation/open calls. ./test/big.c Plugged a memory leak. ./test/h5test.c Added support for the `multi' driver. Removed #warning about not having the stdio driver. Plans are to not implement it since the sec2 driver serves the same purpose and testing didn't show any difference in execution times between the two.
Diffstat (limited to 'test/h5test.c')
-rw-r--r--test/h5test.c85
1 files changed, 51 insertions, 34 deletions
diff --git a/test/h5test.c b/test/h5test.c
index 88a45a9..b6e5551 100644
--- a/test/h5test.c
+++ b/test/h5test.c
@@ -32,6 +32,19 @@
*
*/
+/*
+ * These are the letters that are appended to the file name when generating
+ * names for the split and multi drivers. They are:
+ *
+ * m: All meta data when using the split driver.
+ * s: The userblock, superblock, and driver info block
+ * b: B-tree nodes
+ * r: Dataset raw data
+ * g: Global heap
+ * l: local heap (object names)
+ * o: object headers
+ */
+static const char *multi_letters = "msbrglo";
/*-------------------------------------------------------------------------
@@ -100,22 +113,17 @@ h5_cleanup(hid_t fapl)
}
} else if (H5FD_CORE==driver) {
/*void*/
+ } else if (H5FD_MULTI==driver) {
+ H5FD_mem_t mt;
+ assert(strlen(multi_letters)==H5FD_MEM_NTYPES);
+ for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ HDsnprintf(temp, sizeof temp, "%s-%c.h5",
+ filename, multi_letters[mt]);
+ remove(temp); /*don't care if it fails*/
+ }
} else {
remove(filename);
}
-
-
-#ifndef ROBB_VFL
-#warning "H5F_LOW_SPLIT not implemented"
-#else
- switch (H5Pget_driver(fapl)) {
- case H5F_LOW_SPLIT:
- HDsnprintf(temp, sizeof temp, "%s.raw", filename);
- remove(temp);
- HDsnprintf(temp, sizeof temp, "%s.meta", filename);
- remove(temp);
- break;
-#endif
}
retval=1;
}
@@ -217,20 +225,12 @@ h5_fixname(const char *base_name, hid_t fapl, char *fullname, size_t size)
if ((driver=H5Pget_driver(fapl))<0) return NULL;
if (H5FD_FAMILY==driver) {
suffix = "%05d.h5";
- } else if (H5FD_CORE==driver) {
+ } else if (H5FD_CORE==driver || H5FD_MULTI==driver) {
suffix = NULL;
} else {
suffix = ".h5";
}
-#ifndef RPM_VFL
-#warning "H5FD_SPLIT not implemented"
-#else
- if (H5FD_SPLIT==driver) {
- suffix = NULL;
- }
-#endif
-
if (suffix) {
if (strlen(fullname)+strlen(suffix)>=size) return NULL;
strcat(fullname, suffix);
@@ -266,6 +266,7 @@ h5_fileaccess(void)
char s[1024];
hid_t fapl = -1;
hsize_t fam_size = 100*1024*1024; /*100 MB*/
+ H5FD_mem_t mt;
/* First use the environment variable, then the constant */
val = getenv("HDF5_DRIVER");
@@ -283,24 +284,40 @@ h5_fileaccess(void)
if (!strcmp(name, "sec2")) {
/* Unix read() and write() system calls */
if (H5Pset_fapl_sec2(fapl)<0) return -1;
- } else if (!strcmp(name, "stdio")) {
- /* C standard I/O library */
-#ifndef RPM_VFL
-#warning "H5FD_STDIO not implemented"
-#else
- if (H5Pset_stdio(fapl)<0) return -1;
-#endif
} else if (!strcmp(name, "core")) {
/* In-core temporary file with 1MB increment */
if (H5Pset_fapl_core(fapl, 1024*1024)<0) return -1;
} else if (!strcmp(name, "split")) {
/* Split meta data and raw data each using default driver */
-#ifndef RPM_VFL
-#warning "H5FD_SPLIT not implemented"
-#else
- if (H5Pset_split(fapl, NULL, H5P_DEFAULT, NULL, H5P_DEFAULT)<0)
+ if (H5Pset_fapl_split(fapl,
+ "-m.h5", H5P_DEFAULT,
+ "-r.h5", H5P_DEFAULT)<0)
return -1;
-#endif
+ } else if (!strcmp(name, "multi")) {
+ /* Multi-file driver, general case of the split driver */
+ H5FD_mem_t memb_map[H5FD_MEM_NTYPES];
+ hid_t memb_fapl[H5FD_MEM_NTYPES];
+ const char *memb_name[H5FD_MEM_NTYPES];
+ char sv[H5FD_MEM_NTYPES][1024];
+ haddr_t memb_addr[H5FD_MEM_NTYPES];
+
+ memset(memb_map, 0, sizeof memb_map);
+ memset(memb_fapl, 0, sizeof memb_fapl);
+ memset(memb_name, 0, sizeof memb_name);
+ memset(memb_addr, 0, sizeof memb_addr);
+
+ assert(strlen(multi_letters)==H5FD_MEM_NTYPES);
+ for (mt=0; mt<H5FD_MEM_NTYPES; mt++) {
+ memb_fapl[mt] = H5P_DEFAULT;
+ sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]);
+ memb_name[mt] = sv[mt];
+ memb_addr[mt] = MAX(mt-1,0)*(HADDR_MAX/10);
+ }
+
+ if (H5Pset_fapl_multi(fapl, memb_map, memb_fapl, memb_name,
+ memb_addr)<0) {
+ return -1;
+ }
} else if (!strcmp(name, "family")) {
/* Family of files, each 1MB and using the default driver */
if ((val=strtok(NULL, " \t\n\r"))) {