summaryrefslogtreecommitdiffstats
path: root/tools/src/misc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/src/misc')
-rw-r--r--tools/src/misc/Makefile.in4
-rw-r--r--tools/src/misc/h5clear.c39
-rw-r--r--tools/src/misc/h5repart.c45
3 files changed, 49 insertions, 39 deletions
diff --git a/tools/src/misc/Makefile.in b/tools/src/misc/Makefile.in
index deeb691..2aafd74 100644
--- a/tools/src/misc/Makefile.in
+++ b/tools/src/misc/Makefile.in
@@ -578,7 +578,6 @@ MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYALLOCSANITYCHECK = @MEMORYALLOCSANITYCHECK@
-METADATATRACEFILE = @METADATATRACEFILE@
MKDIR_P = @MKDIR_P@
MPE = @MPE@
NM = @NM@
@@ -612,6 +611,7 @@ PAC_FORTRAN_NUM_INTEGER_KINDS = @PAC_FORTRAN_NUM_INTEGER_KINDS@
PARALLEL = @PARALLEL@
PARALLEL_FILTERED_WRITES = @PARALLEL_FILTERED_WRITES@
PATH_SEPARATOR = @PATH_SEPARATOR@
+PREADWRITE = @PREADWRITE@
PROFILING = @PROFILING@
RANLIB = @RANLIB@
ROOT = @ROOT@
@@ -1556,7 +1556,7 @@ build-check-p: $(LIB) $(PROGS) $(chk_TESTS)
echo "**** Hint ****"; \
echo "Parallel test files reside in the current directory" \
"by default."; \
- echo "Set HDF5_PARAPREFIX to use another directory. E.g.,"; \
+ echo "Set HDF5_PARAPREFIX to use another directory. e.g.,"; \
echo " HDF5_PARAPREFIX=/PFS/user/me"; \
echo " export HDF5_PARAPREFIX"; \
echo " make check"; \
diff --git a/tools/src/misc/h5clear.c b/tools/src/misc/h5clear.c
index 5724e1b..ae57031 100644
--- a/tools/src/misc/h5clear.c
+++ b/tools/src/misc/h5clear.c
@@ -82,7 +82,7 @@ static struct long_options l_opts[] = {
};
-
+
/*-------------------------------------------------------------------------
* Function: usage
*
@@ -119,7 +119,7 @@ static void usage(const char *prog)
HDfprintf(stdout, " Set the EOA to the maximum of (EOA, EOF) + 512 for the file <file_name>.\n");
} /* usage() */
-
+
/*-------------------------------------------------------------------------
* Function: parse_command_line
*
@@ -170,9 +170,12 @@ parse_command_line(int argc, const char **argv)
case 'i':
increment_eoa_eof = TRUE;
- if(opt_arg != NULL && (increment = HDatoi(opt_arg)) < 0) {
- usage(h5tools_getprogname());
- goto done;
+ if(opt_arg != NULL) {
+ if (HDatoi(opt_arg) < 0) {
+ usage(h5tools_getprogname());
+ goto done;
+ }
+ increment = HDatoi(opt_arg);
}
break;
@@ -217,7 +220,7 @@ leave(int ret)
} /* leave() */
-
+
/*-------------------------------------------------------------------------
* Function: main
*
@@ -231,14 +234,14 @@ leave(int ret)
* so the file is opened with write access.
* The --filesize option just prints the EOA and EOF, so the file
* is opened with read access.
- *
+ *
* The -s option will activate the private property:
- * --H5F_ACS_CLEAR_STATUS_FLAGS_NAME
+ * --H5F_ACS_CLEAR_STATUS_FLAGS_NAME
* The --increment option will active these two private properties:
- * --H5F_ACS_NULL_FSM_ADDR_NAME
- * --H5F_ACS_SKIP_EOF_CHECK_NAME
+ * --H5F_ACS_NULL_FSM_ADDR_NAME
+ * --H5F_ACS_SKIP_EOF_CHECK_NAME
* The --filesize will activate the private property:
- * --H5F_ACS_SKIP_EOF_CHECK_NAME
+ * --H5F_ACS_SKIP_EOF_CHECK_NAME
*
* Return: Success: 0
* Failure: 1
@@ -280,7 +283,7 @@ main (int argc, const char *argv[])
}
/* Cannot combine the --filesize option with other options */
- if(print_filesize &&
+ if(print_filesize &&
(clear_status_flags || remove_cache_image || increment_eoa_eof)) {
error_msg("Cannot combine --filesize with other options\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -298,7 +301,7 @@ main (int argc, const char *argv[])
}
/* -s option */
- if(clear_status_flags) {
+ if(clear_status_flags) {
/* Set to clear the status_flags in the file's superblock */
/* Activate this private property */
if(H5Pset(fapl, H5F_ACS_CLEAR_STATUS_FLAGS_NAME, &clear_status_flags) < 0) {
@@ -309,7 +312,7 @@ main (int argc, const char *argv[])
}
/* --increment option */
- if(increment_eoa_eof) {
+ if(increment_eoa_eof) {
/* Activate this private property */
if(H5Pset(fapl, H5F_ACS_SKIP_EOF_CHECK_NAME, &increment_eoa_eof) < 0) {
error_msg("H5Pset\n");
@@ -325,7 +328,7 @@ main (int argc, const char *argv[])
}
/* --filesize option; open the file read-only */
- if(print_filesize) {
+ if(print_filesize) {
/* Activate this private property */
if(H5Pset(fapl, H5F_ACS_SKIP_EOF_CHECK_NAME, &print_filesize) < 0) {
error_msg("H5Pset\n");
@@ -333,7 +336,7 @@ main (int argc, const char *argv[])
goto done;
}
flags = H5F_ACC_RDONLY;
- }
+ }
/* Open the file */
if((fid = h5tools_fopen(fname, flags, fapl, NULL, NULL, (size_t)0)) < 0) {
@@ -367,7 +370,7 @@ main (int argc, const char *argv[])
}
/* -m option */
- if(remove_cache_image) {
+ if(remove_cache_image) {
if(H5Fget_mdc_image_info(fid, &image_addr, &image_len) < 0) {
error_msg("H5Fget_mdc_image_info\n");
h5tools_setstatus(EXIT_FAILURE);
@@ -375,7 +378,7 @@ main (int argc, const char *argv[])
}
if(image_addr == HADDR_UNDEF && image_len == 0)
warn_msg("No cache image in the file\n");
- }
+ }
h5tools_setstatus(EXIT_SUCCESS);
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) {