summaryrefslogtreecommitdiffstats
path: root/src/H5FDfamily.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 /src/H5FDfamily.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 'src/H5FDfamily.c')
-rw-r--r--src/H5FDfamily.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/H5FDfamily.c b/src/H5FDfamily.c
index bf46efc..4f0536c 100644
--- a/src/H5FDfamily.c
+++ b/src/H5FDfamily.c
@@ -58,6 +58,7 @@ typedef struct H5FD_family_dxpl_t {
} H5FD_family_dxpl_t;
/* Callback prototypes */
+static void *H5FD_family_fapl_get(H5FD_t *_file);
static void *H5FD_family_fapl_copy(const void *_old_fa);
static herr_t H5FD_family_fapl_free(void *_fa);
static void *H5FD_family_dxpl_copy(const void *_old_dx);
@@ -79,7 +80,11 @@ static herr_t H5FD_family_flush(H5FD_t *_file);
static const H5FD_class_t H5FD_family_g = {
"family", /*name */
HADDR_MAX, /*maxaddr */
+ NULL, /*sb_size */
+ NULL, /*sb_encode */
+ NULL, /*sb_decode */
sizeof(H5FD_family_fapl_t), /*fapl_size */
+ H5FD_family_fapl_get, /*fapl_get */
H5FD_family_fapl_copy, /*fapl_copy */
H5FD_family_fapl_free, /*fapl_free */
sizeof(H5FD_family_dxpl_t), /*dxpl_size */
@@ -159,7 +164,10 @@ H5Pset_fapl_family(hid_t fapl_id, hsize_t memb_size, hid_t memb_fapl_id)
if (H5P_DEFAULT!=memb_fapl_id &&
H5P_FILE_ACCESS!=H5Pget_class(memb_fapl_id)) return -1;
- /* Initialize driver specific information */
+ /*
+ * Initialize driver specific information. No need to copy it into the FA
+ * struct since all members will be copied by H5Pset_driver().
+ */
fa.memb_size = memb_size;
fa.memb_fapl_id = memb_fapl_id;
return H5Pset_driver(fapl_id, H5FD_FAMILY, &fa);
@@ -201,6 +209,35 @@ H5Pget_fapl_family(hid_t fapl_id, hsize_t *memb_size/*out*/,
/*-------------------------------------------------------------------------
+ * Function: H5FD_family_fapl_get
+ *
+ * Purpose: Gets a file access property list which could be used to
+ * create an identical file.
+ *
+ * Return: Success: Ptr to new file access property list.
+ *
+ * Failure: NULL
+ *
+ * Programmer: Robb Matzke
+ * Friday, August 13, 1999
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+static void *
+H5FD_family_fapl_get(H5FD_t *_file)
+{
+ H5FD_family_t *file = (H5FD_family_t*)_file;
+ H5FD_family_fapl_t *fa = calloc(1, sizeof(H5FD_family_fapl_t*));
+
+ fa->memb_size = file->memb_size;
+ fa->memb_fapl_id = H5Pcopy(file->memb_fapl_id);
+ return fa;
+}
+
+
+/*-------------------------------------------------------------------------
* Function: H5FD_family_fapl_copy
*
* Purpose: Copies the family-specific file access properties.
@@ -348,7 +385,7 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
file->memb_size = 1024*1024*1024; /*1GB*/
} else {
H5FD_family_fapl_t *fa = H5Pget_driver_info(fapl_id);
- file->memb_fapl_id = fa->memb_fapl_id;
+ file->memb_fapl_id = H5Pcopy(fa->memb_fapl_id);
file->memb_size = fa->memb_size;
}
file->name = malloc(strlen(name)+1);
@@ -408,6 +445,9 @@ H5FD_family_open(const char *name, unsigned flags, hid_t fapl_id,
for (i=0; i<file->nmembs; i++) {
if (file->memb[i]) H5FDclose(file->memb[i]);
}
+ if (file->memb) free(file->memb);
+ H5Pclose(file->memb_fapl_id);
+ if (file->name) free(file->name);
free(file);
}
return NULL;