summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2018-11-24 07:46:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2018-11-24 07:46:08 (GMT)
commit5fc251dc59cc32879a22915ed97b4d93736d7d74 (patch)
treee1af95e241da39dcc4e6e9bdf780404c27b44f90
parent67db60c2c293be2a949fadadbe5b8e5fd4fb658a (diff)
parent2b616c7c183592010bcfa151060f52f729d01867 (diff)
downloadhdf5-5fc251dc59cc32879a22915ed97b4d93736d7d74.zip
hdf5-5fc251dc59cc32879a22915ed97b4d93736d7d74.tar.gz
hdf5-5fc251dc59cc32879a22915ed97b4d93736d7d74.tar.bz2
Merge pull request #1340 in HDFFV/hdf5 from ~DEROBINS/hdf5_der:hdf5_1_10 to hdf5_1_10
* commit '2b616c7c183592010bcfa151060f52f729d01867': Renamed h5repart's -family_to_sec2 to -family_to_single.
-rw-r--r--release_docs/RELEASE.txt12
-rw-r--r--src/H5FDlog.c16
-rw-r--r--src/H5FDsec2.c16
-rw-r--r--src/H5Fprivate.h2
-rw-r--r--src/H5Pfapl.c15
-rw-r--r--tools/src/misc/h5repart.c45
-rw-r--r--tools/test/misc/CMakeTestsRepart.cmake5
-rw-r--r--tools/test/misc/repart_test.c21
-rw-r--r--tools/test/misc/testh5repart.sh.in6
9 files changed, 85 insertions, 53 deletions
diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt
index b0ae212..dc0c2f3 100644
--- a/release_docs/RELEASE.txt
+++ b/release_docs/RELEASE.txt
@@ -104,7 +104,17 @@ New Features
Tools:
------
- -
+ - The h5repart -family-to-sec2 argument was changed to -family-to-single
+
+ In order to better support other single-file VFDs which could work with
+ h5repart, the -family-to-sec2 argument was renamed to -family-to-single.
+ This is just a name change and the functionality of the argument has not
+ changed.
+
+ The -family-to-sec2 argument has been kept for backwards-compatibility.
+ This argument should be considered deprecated.
+
+ (DER - 2018/11/14, HDFFV-10633)
High-Level APIs:
---------------
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index 7c2297a..3dcd7f5 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -117,7 +117,7 @@ typedef struct H5FD_log_t {
* Whether to eliminate the family driver info and convert this file to
* a single file
*/
- hbool_t fam_to_sec2;
+ hbool_t fam_to_single;
/* Fields for tracking I/O operations */
unsigned char *nread; /* Number of reads from a file location */
@@ -635,13 +635,13 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
/* Check for non-default FAPL */
if(H5P_FILE_ACCESS_DEFAULT != fapl_id) {
/* This step is for h5repart tool only. If user wants to change file driver from
- * family to sec2 while using h5repart, this private property should be set so that
- * in the later step, the library can ignore the family driver information saved
- * in the superblock.
+ * family to one that uses single files (sec2, etc.) while using h5repart, this
+ * private property should be set so that in the later step, the library can ignore
+ * the family driver information saved in the superblock.
*/
- if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0)
- if(H5P_get(plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &file->fam_to_sec2) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to sec2")
+ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME) > 0)
+ if(H5P_get(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME, &file->fam_to_single) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to single")
} /* end if */
/* Set return value */
@@ -900,7 +900,7 @@ H5FD_log_query(const H5FD_t *_file, unsigned long *flags /* out */)
*flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */
/* Check for flags that are set by h5repart */
- if(file && file->fam_to_sec2)
+ if(file && file->fam_to_single)
*flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */
} /* end if */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 32aff0f..06c008d 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -94,7 +94,7 @@ typedef struct H5FD_sec2_t {
* Whether to eliminate the family driver info and convert this file to
* a single file.
*/
- hbool_t fam_to_sec2;
+ hbool_t fam_to_single;
} H5FD_sec2_t;
@@ -386,13 +386,13 @@ H5FD_sec2_open(const char *name, unsigned flags, hid_t fapl_id, haddr_t maxaddr)
HGOTO_ERROR(H5E_VFL, H5E_BADTYPE, NULL, "not a file access property list")
/* This step is for h5repart tool only. If user wants to change file driver from
- * family to sec2 while using h5repart, this private property should be set so that
- * in the later step, the library can ignore the family driver information saved
- * in the superblock.
+ * family to one that uses single files (sec2, etc.) while using h5repart, this
+ * private property should be set so that in the later step, the library can ignore
+ * the family driver information saved in the superblock.
*/
- if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SEC2_NAME) > 0)
- if(H5P_get(plist, H5F_ACS_FAMILY_TO_SEC2_NAME, &file->fam_to_sec2) < 0)
- HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to sec2")
+ if(H5P_exist_plist(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME) > 0)
+ if(H5P_get(plist, H5F_ACS_FAMILY_TO_SINGLE_NAME, &file->fam_to_single) < 0)
+ HGOTO_ERROR(H5E_VFL, H5E_CANTGET, NULL, "can't get property of changing family to single")
} /* end if */
/* Set return value */
@@ -532,7 +532,7 @@ H5FD_sec2_query(const H5FD_t *_file, unsigned long *flags /* out */)
*flags |= H5FD_FEAT_DEFAULT_VFD_COMPATIBLE; /* VFD creates a file which can be opened with the default VFD */
/* Check for flags that are set by h5repart */
- if(file && file->fam_to_sec2)
+ if(file && file->fam_to_single)
*flags |= H5FD_FEAT_IGNORE_DRVRINFO; /* Ignore the driver info when file is opened (which eliminates it) */
} /* end if */
diff --git a/src/H5Fprivate.h b/src/H5Fprivate.h
index 700cb89..370e80b 100644
--- a/src/H5Fprivate.h
+++ b/src/H5Fprivate.h
@@ -482,7 +482,7 @@ typedef struct H5F_t H5F_t;
#define H5F_ACS_CLOSE_DEGREE_NAME "close_degree" /* File close degree */
#define H5F_ACS_FAMILY_OFFSET_NAME "family_offset" /* Offset position in file for family file driver */
#define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize" /* New member size of family driver. (private property only used by h5repart) */
-#define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2" /* Whether to convert family to sec2 driver. (private property only used by h5repart) */
+#define H5F_ACS_FAMILY_TO_SINGLE_NAME "family_to_single" /* Whether to convert family to a single-file driver. (private property only used by h5repart) */
#define H5F_ACS_MULTI_TYPE_NAME "multi_type" /* Data type in multi file driver */
#define H5F_ACS_LIBVER_LOW_BOUND_NAME "libver_low_bound" /* 'low' bound of library format versions */
#define H5F_ACS_LIBVER_HIGH_BOUND_NAME "libver_high_bound" /* 'high' bound of library format versions */
diff --git a/src/H5Pfapl.c b/src/H5Pfapl.c
index c94fda1..e5a0a63 100644
--- a/src/H5Pfapl.c
+++ b/src/H5Pfapl.c
@@ -131,10 +131,11 @@
* property only used by h5repart */
#define H5F_ACS_FAMILY_NEWSIZE_SIZE sizeof(hsize_t)
#define H5F_ACS_FAMILY_NEWSIZE_DEF 0
-/* Definition for whether to convert family to sec2 driver. It's private
- * property only used by h5repart */
-#define H5F_ACS_FAMILY_TO_SEC2_SIZE sizeof(hbool_t)
-#define H5F_ACS_FAMILY_TO_SEC2_DEF FALSE
+/* Definition for whether to convert family to a single-file driver.
+ * It's a private property only used by h5repart.
+ */
+#define H5F_ACS_FAMILY_TO_SINGLE_SIZE sizeof(hbool_t)
+#define H5F_ACS_FAMILY_TO_SINGLE_DEF FALSE
/* Definition for data type in multi file driver */
#define H5F_ACS_MULTI_TYPE_SIZE sizeof(H5FD_mem_t)
#define H5F_ACS_MULTI_TYPE_DEF H5FD_MEM_DEFAULT
@@ -368,7 +369,7 @@ static const unsigned H5F_def_gc_ref_g = H5F_ACS_GARBG_COLCT_REF_DEF;
static const H5F_close_degree_t H5F_def_close_degree_g = H5F_CLOSE_DEGREE_DEF; /* Default file close degree */
static const hsize_t H5F_def_family_offset_g = H5F_ACS_FAMILY_OFFSET_DEF; /* Default offset for family VFD */
static const hsize_t H5F_def_family_newsize_g = H5F_ACS_FAMILY_NEWSIZE_DEF; /* Default size of new files for family VFD */
-static const hbool_t H5F_def_family_to_sec2_g = H5F_ACS_FAMILY_TO_SEC2_DEF; /* Default ?? for family VFD */
+static const hbool_t H5F_def_family_to_single_g = H5F_ACS_FAMILY_TO_SINGLE_DEF; /* Default ?? for family VFD */
static const H5FD_mem_t H5F_def_mem_type_g = H5F_ACS_MULTI_TYPE_DEF; /* Default file space type for multi VFD */
static const H5F_libver_t H5F_def_libver_low_bound_g = H5F_ACS_LIBVER_LOW_BOUND_DEF; /* Default setting for "low" bound of format version */
@@ -503,9 +504,9 @@ H5P__facc_reg_prop(H5P_genclass_t *pclass)
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
- /* Register the private property of whether convert family to sec2 driver. It's used by h5repart only. */
+ /* Register the private property of whether convert family to a single-file driver. It's used by h5repart only. */
/* (Note: this property should not have an encode/decode callback -QAK) */
- if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SEC2_NAME, H5F_ACS_FAMILY_TO_SEC2_SIZE, &H5F_def_family_to_sec2_g,
+ if(H5P_register_real(pclass, H5F_ACS_FAMILY_TO_SINGLE_NAME, H5F_ACS_FAMILY_TO_SINGLE_SIZE, &H5F_def_family_to_single_g,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
diff --git a/tools/src/misc/h5repart.c b/tools/src/misc/h5repart.c
index cdc554f..2f4d93e 100644
--- a/tools/src/misc/h5repart.c
+++ b/tools/src/misc/h5repart.c
@@ -29,11 +29,12 @@
#define NAMELEN 4096
#define GB *1024*1024*1024
-/*Make these 2 private properties(defined in H5Fprivate.h) available to h5repart.
- *The first one updates the member file size in the superblock. The second one
- *change file driver from family to sec2. */
+/* Make these 2 private properties(defined in H5Fprivate.h) available to h5repart.
+ * The first one updates the member file size in the superblock. The second one
+ * change file driver from family to a single file driver.
+ */
#define H5F_ACS_FAMILY_NEWSIZE_NAME "family_newsize"
-#define H5F_ACS_FAMILY_TO_SEC2_NAME "family_to_sec2"
+#define H5F_ACS_FAMILY_TO_SINGLE_NAME "family_to_single"
/*-------------------------------------------------------------------------
@@ -53,13 +54,14 @@
static void
usage (const char *progname)
{
- fprintf(stderr, "usage: %s [-v] [-V] [-[b|m] N[g|m|k]] [-family_to_sec2] SRC DST\n",
+ fprintf(stderr, "usage: %s [-v] [-V] [-[b|m] N[g|m|k]] [-family_to_sec2|-family_to_single] SRC DST\n",
progname);
fprintf(stderr, " -v Produce verbose output\n");
fprintf(stderr, " -V Print a version number and exit\n");
fprintf(stderr, " -b N The I/O block size, defaults to 1kB\n");
fprintf(stderr, " -m N The destination member size or 1GB\n");
- fprintf(stderr, " -family_to_sec2 Change file driver from family to sec2\n");
+ fprintf(stderr, " -family_to_sec2 Deprecated version of -family_to_single (below)\n");
+ fprintf(stderr, " -family_to_single Change file driver from family to the default single-file VFD (windows or sec2)\n");
fprintf(stderr, " SRC The name of the source file\n");
fprintf(stderr, " DST The name of the destination files\n");
fprintf(stderr, "Sizes may be suffixed with `g' for GB, `m' for MB or "
@@ -186,7 +188,7 @@ main (int argc, char *argv[])
hid_t fapl; /*file access property list */
hid_t file;
hsize_t hdsize; /*destination logical memb size */
- hbool_t family_to_sec2=FALSE; /*change family to sec2 driver? */
+ hbool_t family_to_single = FALSE; /*change family to single file driver? */
/*
* Get the program name from argv[0]. Use only the last component.
@@ -206,7 +208,10 @@ main (int argc, char *argv[])
prog_name, H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE);
exit(EXIT_SUCCESS);
} else if (!strcmp (argv[argno], "-family_to_sec2")) {
- family_to_sec2 = TRUE;
+ family_to_single = TRUE;
+ argno++;
+ } else if (!strcmp (argv[argno], "-family_to_single")) {
+ family_to_single = TRUE;
argno++;
} else if ('b'==argv[argno][1]) {
blk_size = (size_t)get_size (prog_name, &argno, argc, argv);
@@ -422,11 +427,12 @@ main (int argc, char *argv[])
exit (EXIT_FAILURE);
}
- if(family_to_sec2) {
- /* The user wants to change file driver from family to sec2. Open the file
- * with sec2 driver. This property signals the library to ignore the family
- * driver information saved in the superblock. */
- if(H5Pset(fapl, H5F_ACS_FAMILY_TO_SEC2_NAME, &family_to_sec2) < 0) {
+ if(family_to_single) {
+ /* The user wants to change file driver from family to a single-file VFD.
+ * Open the file with the sec2, windows, etc. driver. This property signals
+ * the library to ignore the family driver information saved in the superblock.
+ */
+ if(H5Pset(fapl, H5F_ACS_FAMILY_TO_SINGLE_NAME, &family_to_single) < 0) {
perror ("H5Pset");
exit (EXIT_FAILURE);
}
@@ -449,13 +455,14 @@ main (int argc, char *argv[])
/* If the new file is a family file, try to open file for "read and write" to
* flush metadata. Flushing metadata will update the superblock to the new
- * member size. If the original file is a family file and the new file is a sec2
- * file, the property FAMILY_TO_SEC2 will signal the library to switch to sec2
- * driver when the new file is opened. If the original file is a sec2 file and the
- * new file can only be a sec2 file, reopen the new file should fail. There's
- * nothing to do in this case. */
+ * member size. If the original file is a family file and the new file is a single
+ * file, the property FAMILY_TO_SINGLE will signal the library to switch to default
+ * single-file driver when the new file is opened. If the original file is a single
+ * file and the new file can only be a single file, reopen the new file should fail.
+ * There's nothing to do in this case.
+ */
H5E_BEGIN_TRY {
- file=H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl);
+ file = H5Fopen(dst_gen_name, H5F_ACC_RDWR, fapl);
} H5E_END_TRY;
if(file>=0) {
diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake
index 37da903..830de11 100644
--- a/tools/test/misc/CMakeTestsRepart.cmake
+++ b/tools/test/misc/CMakeTestsRepart.cmake
@@ -68,6 +68,7 @@
scd_family00001.h5
scd_family00002.h5
scd_family00003.h5
+ family_to_single.h5
family_to_sec2.h5
)
if (NOT "${last_test}" STREQUAL "")
@@ -84,6 +85,10 @@
set_tests_properties (H5REPART-h5repart_5K PROPERTIES DEPENDS H5REPART-clearall-objects)
# convert family file to sec2 file of 20,000 bytes
+ add_test (NAME H5REPART-h5repart_single COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5)
+ set_tests_properties (H5REPART-h5repart_single PROPERTIES DEPENDS H5REPART-clearall-objects)
+
+ # convert family file to sec2 file of 20,000 bytes (old argument)
add_test (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5)
set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES DEPENDS H5REPART-clearall-objects)
diff --git a/tools/test/misc/repart_test.c b/tools/test/misc/repart_test.c
index 4016ee8..b8e0292 100644
--- a/tools/test/misc/repart_test.c
+++ b/tools/test/misc/repart_test.c
@@ -26,12 +26,13 @@
const char *FILENAME[] = {
"fst_family%05d.h5",
"scd_family%05d.h5",
+ "family_to_single.h5",
"family_to_sec2.h5",
NULL
};
herr_t test_family_h5repart_opens(void);
-herr_t test_sec2_h5repart_opens(void);
+herr_t test_single_h5repart_opens(void);
/*-------------------------------------------------------------------------
@@ -90,23 +91,28 @@ error:
/*-------------------------------------------------------------------------
- * Function: test_sec2_h5repart_opens
+ * Function: test_single_h5repart_opens
*
- * Purpose: Tries to reopen a sec2 file.
+ * Purpose: Tries to reopen a single file.
*
* Return: SUCCEED/FAIL
*
*-------------------------------------------------------------------------
*/
herr_t
-test_sec2_h5repart_opens(void)
+test_single_h5repart_opens(void)
{
hid_t fid = -1;
- /* open the sec2 file */
+ /* open the single file */
if ((fid = H5Fopen(FILENAME[2], H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
goto error;
+ if (H5Fclose(fid) < 0)
+ goto error;
+ /* open the single file (created using the old argument) */
+ if ((fid = H5Fopen(FILENAME[3], H5F_ACC_RDWR, H5P_DEFAULT)) < 0)
+ goto error;
if (H5Fclose(fid) < 0)
goto error;
@@ -119,7 +125,7 @@ error:
return FAIL;
-} /* end test_sec2_h5repart_opens() */
+} /* end test_single_h5repart_opens() */
/*-------------------------------------------------------------------------
@@ -137,7 +143,7 @@ main(void)
int nerrors = 0;
nerrors += test_family_h5repart_opens() < 0 ? 1 : 0;
- nerrors += test_sec2_h5repart_opens() < 0 ? 1 : 0;
+ nerrors += test_single_h5repart_opens() < 0 ? 1 : 0;
if (nerrors)
goto error;
@@ -150,3 +156,4 @@ error:
nerrors, 1 == nerrors ? "" : "S");
HDexit(EXIT_FAILURE);
} /* end main() */
+
diff --git a/tools/test/misc/testh5repart.sh.in b/tools/test/misc/testh5repart.sh.in
index 594d37e..143f607 100644
--- a/tools/test/misc/testh5repart.sh.in
+++ b/tools/test/misc/testh5repart.sh.in
@@ -171,7 +171,9 @@ COPY_TESTFILES_TO_TESTDIR
TOOLTEST -m 20000 family_file%05d.h5 fst_family%05d.h5
# repartition family member size to 5 KB.
TOOLTEST -m 5k family_file%05d.h5 scd_family%05d.h5
-# convert family file to sec2 file of 20,000 bytes
+# convert family file to single file of 20,000 bytes
+TOOLTEST -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5
+# convert family file to single file of 20,000 bytes (old argument)
TOOLTEST -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5
# test the output files repartitioned above.
@@ -183,7 +185,7 @@ CLEAN_TESTFILES_AND_TESTDIR
if test -z "$HDF5_NOCLEANUP"; then
cd $actual_dir
- rm -f fst_family*.h5 scd_family*.h5 family_to_sec2.h5
+ rm -f fst_family*.h5 scd_family*.h5 family_to_single.h5 family_to_sec2.h5
fi
if test $nerrors -eq 0 ; then