summaryrefslogtreecommitdiffstats
path: root/test/vfd.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2014-04-09 03:35:16 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2014-04-09 03:35:16 (GMT)
commit5ae7ad342d42a9d6384edc3e465f57fa35ada5de (patch)
treed31e668a0fc35d221aa6c446ad52c007d10f465a /test/vfd.c
parent385b4b40ae69ca45be476472ce1c8e5391a63caa (diff)
downloadhdf5-5ae7ad342d42a9d6384edc3e465f57fa35ada5de.zip
hdf5-5ae7ad342d42a9d6384edc3e465f57fa35ada5de.tar.gz
hdf5-5ae7ad342d42a9d6384edc3e465f57fa35ada5de.tar.bz2
[svn-r24993] Purpose:
Adds write tracking to the core VFD, which can be configured via the H5Pset/get_core_write_tracking() API call. When enabled and writing to the backing store is enabled, this feature will track writes and only write out the changed bytes on flush/close. Tested on: 32-bit LE linux (jam) w/ Fortran and C++ 64-bit BE linux (ostrich) 64-bit Darwin 12.5.0 (kite) All were tested using the core VFD w/ paging on (core_paged in the VFD list). Make check-vfd was also tested on jam.
Diffstat (limited to 'test/vfd.c')
-rw-r--r--test/vfd.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/vfd.c b/test/vfd.c
index b85c054..4ece2ba 100644
--- a/test/vfd.c
+++ b/test/vfd.c
@@ -28,6 +28,7 @@
#define FAMILY_SIZE2 (5*KB)
#define MULTI_SIZE 128
#define CORE_INCREMENT (4*KB)
+#define CORE_PAGE_SIZE (1024 * 1024)
#define DSET1_NAME "dset1"
#define DSET1_DIM1 1024
#define DSET1_DIM2 32
@@ -376,6 +377,8 @@ test_core(void)
char filename[1024];
void *fhandle=NULL;
hsize_t file_size;
+ hbool_t use_write_tracking;
+ size_t write_tracking_page_size;
int *points = NULL, *check = NULL, *p1, *p2;
hid_t dset1=-1, space1=-1;
hsize_t dims1[2];
@@ -387,6 +390,8 @@ test_core(void)
fapl = h5_fileaccess();
if(H5Pset_fapl_core(fapl, (size_t)CORE_INCREMENT, TRUE) < 0)
TEST_ERROR;
+ if(H5Pset_core_write_tracking(fapl, TRUE, CORE_PAGE_SIZE) < 0)
+ TEST_ERROR;
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
@@ -400,6 +405,14 @@ test_core(void)
if(H5FD_CORE != H5Pget_driver(access_fapl))
TEST_ERROR;
+ /* Check that the backing store write tracking info was saved */
+ if(H5Pget_core_write_tracking(fapl, &use_write_tracking, &write_tracking_page_size) < 0)
+ TEST_ERROR;
+ if(TRUE != use_write_tracking)
+ TEST_ERROR;
+ if(CORE_PAGE_SIZE != write_tracking_page_size)
+ TEST_ERROR;
+
/* ...and close the property list */
if (H5Pclose(access_fapl) < 0)
TEST_ERROR;