Compare commits
14 Commits
feature/ap
...
CCP_proto1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7badfb2ed9 | ||
|
|
5740d86352 | ||
|
|
d5059f43fc | ||
|
|
a2d2a46c45 | ||
|
|
724c6eeebd | ||
|
|
c939a9ca8a | ||
|
|
b93fe59be1 | ||
|
|
a07ebb24c8 | ||
|
|
061f65107c | ||
|
|
c0a409c9b5 | ||
|
|
8349fd1e31 | ||
|
|
b7e411318c | ||
|
|
fc10e9680d | ||
|
|
47753064dc |
4
MANIFEST
4
MANIFEST
@@ -1241,6 +1241,9 @@
|
||||
# h5repack sources
|
||||
./tools/h5repack/Makefile.am
|
||||
./tools/h5repack/Makefile.in
|
||||
./tools/h5repack/ccp_docs/CompressNChunk_RFC.docx
|
||||
./tools/h5repack/ccp_docs/CompressNChunk_RFC.pdf
|
||||
./tools/h5repack/ccp_docs/h5repack.htm
|
||||
./tools/h5repack/dynlib_rpk.c
|
||||
./tools/h5repack/h5repack.sh.in
|
||||
./tools/h5repack/h5repack_plugin.sh.in
|
||||
@@ -1256,6 +1259,7 @@
|
||||
./tools/h5repack/h5repacktst.c
|
||||
./tools/h5repack/testh5repack_detect_szip.c
|
||||
|
||||
|
||||
# h5ls sources
|
||||
./tools/h5ls/Makefile.am
|
||||
./tools/h5ls/Makefile.in
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
HDF5 version 1.9.218 currently under development
|
||||
HDF5 version 1.9.218-ccp_proto1 released on 2015-05-28
|
||||
Please refer to the release_docs/INSTALL file for installation instructions.
|
||||
------------------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = "HDF5 C++ API"
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = HDF5 version 1.9.218 currently under development
|
||||
PROJECT_NUMBER = HDF5 version 1.9.218-ccp_proto1 currently under development
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
22
configure
vendored
22
configure
vendored
@@ -1,7 +1,7 @@
|
||||
#! /bin/sh
|
||||
# From configure.ac Id: configure.ac 22697 2012-08-19 14:35:47Z hdftest .
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for HDF5 1.9.218.
|
||||
# Generated by GNU Autoconf 2.69 for HDF5 1.9.218-ccp_proto1.
|
||||
#
|
||||
# Report bugs to <help@hdfgroup.org>.
|
||||
#
|
||||
@@ -591,8 +591,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='HDF5'
|
||||
PACKAGE_TARNAME='hdf5'
|
||||
PACKAGE_VERSION='1.9.218'
|
||||
PACKAGE_STRING='HDF5 1.9.218'
|
||||
PACKAGE_VERSION='1.9.218-ccp_proto1'
|
||||
PACKAGE_STRING='HDF5 1.9.218-ccp_proto1'
|
||||
PACKAGE_BUGREPORT='help@hdfgroup.org'
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1472,7 +1472,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures HDF5 1.9.218 to adapt to many kinds of systems.
|
||||
\`configure' configures HDF5 1.9.218-ccp_proto1 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1542,7 +1542,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of HDF5 1.9.218:";;
|
||||
short | recursive ) echo "Configuration of HDF5 1.9.218-ccp_proto1:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1731,7 +1731,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
HDF5 configure 1.9.218
|
||||
HDF5 configure 1.9.218-ccp_proto1
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2668,7 +2668,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by HDF5 $as_me 1.9.218, which was
|
||||
It was created by HDF5 $as_me 1.9.218-ccp_proto1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -3539,7 +3539,7 @@ fi
|
||||
|
||||
# Define the identity of the package.
|
||||
PACKAGE='hdf5'
|
||||
VERSION='1.9.218'
|
||||
VERSION='1.9.218-ccp_proto1'
|
||||
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
@@ -28577,7 +28577,7 @@ Usage: $0 [OPTIONS]
|
||||
Report bugs to <bug-libtool@gnu.org>."
|
||||
|
||||
lt_cl_version="\
|
||||
HDF5 config.lt 1.9.218
|
||||
HDF5 config.lt 1.9.218-ccp_proto1
|
||||
configured by $0, generated by GNU Autoconf 2.69.
|
||||
|
||||
Copyright (C) 2011 Free Software Foundation, Inc.
|
||||
@@ -30693,7 +30693,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by HDF5 $as_me 1.9.218, which was
|
||||
This file was extended by HDF5 $as_me 1.9.218-ccp_proto1, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -30759,7 +30759,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
HDF5 config.status 1.9.218
|
||||
HDF5 config.status 1.9.218-ccp_proto1
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ AC_PREREQ([2.69])
|
||||
## NOTE: Do not forget to change the version number here when we do a
|
||||
## release!!!
|
||||
##
|
||||
AC_INIT([HDF5], [1.9.218], [help@hdfgroup.org])
|
||||
AC_INIT([HDF5], [1.9.218-ccp_proto1], [help@hdfgroup.org])
|
||||
AC_CONFIG_SRCDIR([src/H5.c])
|
||||
AC_CONFIG_HEADER([src/H5config.h])
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
HDF5 version 1.9.218 currently under development
|
||||
HDF5 version 1.9.218-ccp_proto1 released on 2015-05-28
|
||||
================================================================================
|
||||
|
||||
|
||||
|
||||
@@ -95,9 +95,9 @@ extern "C" {
|
||||
#define H5_VERS_MAJOR 1 /* For major interface/format changes */
|
||||
#define H5_VERS_MINOR 9 /* For minor interface/format changes */
|
||||
#define H5_VERS_RELEASE 218 /* For tweaks, bug-fixes, or development */
|
||||
#define H5_VERS_SUBRELEASE "" /* For pre-releases like snap0 */
|
||||
#define H5_VERS_SUBRELEASE "ccp_proto1" /* For pre-releases like snap0 */
|
||||
/* Empty string for real releases. */
|
||||
#define H5_VERS_INFO "HDF5 library version: 1.9.218" /* Full version string */
|
||||
#define H5_VERS_INFO "HDF5 library version: 1.9.218-ccp_proto1" /* Full version string */
|
||||
|
||||
#define H5check() H5check_version(H5_VERS_MAJOR,H5_VERS_MINOR, \
|
||||
H5_VERS_RELEASE)
|
||||
|
||||
BIN
tools/h5repack/ccp_docs/CompressNChunk_RFC.docx
Normal file
BIN
tools/h5repack/ccp_docs/CompressNChunk_RFC.docx
Normal file
Binary file not shown.
BIN
tools/h5repack/ccp_docs/CompressNChunk_RFC.pdf
Normal file
BIN
tools/h5repack/ccp_docs/CompressNChunk_RFC.pdf
Normal file
Binary file not shown.
469
tools/h5repack/ccp_docs/h5repack.htm
Normal file
469
tools/h5repack/ccp_docs/h5repack.htm
Normal file
@@ -0,0 +1,469 @@
|
||||
|
||||
|
||||
<!--
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
* Copyright by The HDF Group. *
|
||||
* Copyright by the Board of Trustees of the University of Illinois. *
|
||||
* All rights reserved. *
|
||||
* *
|
||||
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
||||
* terms governing use, modification, and redistribution, is contained in *
|
||||
* the files COPYING and Copyright.html. COPYING can be found at the root *
|
||||
* of the source code distribution tree; Copyright.html can be found at the *
|
||||
* root level of an installed copy of the electronic HDF5 document set and *
|
||||
* is linked from the top-level documents page. It can also be found at *
|
||||
* http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
|
||||
* access to either file, you may request a copy from help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
-->
|
||||
|
||||
|
||||
<!-- NEW PAGE -->
|
||||
<!-- HEADER RIGHT "h5repack" -->
|
||||
<hr>
|
||||
<dl>
|
||||
|
||||
<dt><div align=right><font color=999999 size=-1><i>
|
||||
Last modified: 10 September 2013
|
||||
</i></font></div>
|
||||
|
||||
<dt><strong>Tool Name:</strong> <a name="Tools-Repack">h5repack</a>
|
||||
|
||||
<dt><strong>Syntax:</strong>
|
||||
<dd><code>h5repack </code>
|
||||
[<em>OPTIONS</em>]
|
||||
<em>in_file</em>
|
||||
<em>out_file</em>
|
||||
<p>
|
||||
<dd><code>h5repack </code>
|
||||
<code>-i</code> <em>in_file</em>
|
||||
<code>-o</code> <em>out_file</em>
|
||||
[<em>OPTIONS</em>]
|
||||
|
||||
<p>
|
||||
<dt><strong>Purpose:</strong>
|
||||
<dd>Copies an HDF5 file to a new file with or without compression
|
||||
and/or chunking.
|
||||
|
||||
<p>
|
||||
<dt><strong>Description:</strong>
|
||||
<dd><code>h5repack</code> is a command line tool that
|
||||
applies HDF5 filters to an input file <em>in_file</em>,
|
||||
saving the output in a new output file, <em>out_file</em>.
|
||||
|
||||
<p>
|
||||
<dt><strong>Options and Parameters:</strong>
|
||||
<dd>
|
||||
<dl>
|
||||
<dt><code>-i</code> <em>in_file</em>
|
||||
<dd>Input HDF5 file
|
||||
<p>
|
||||
<dt><code>-o</code> <em>out_file</em>
|
||||
<dd>Output HDF5 file
|
||||
<p>
|
||||
<dt><code>-h</code>
|
||||
or
|
||||
<code>--help</code>
|
||||
<dd>Print help message.
|
||||
<p>
|
||||
<dt><code>-v</code>
|
||||
or
|
||||
<code>--verbose</code>
|
||||
<dd>Print verbose output.
|
||||
<p>
|
||||
<dt><code>-V</code>
|
||||
or
|
||||
<code>--version</code>
|
||||
<dd>Print version number.
|
||||
<p>
|
||||
<dt><code>-n</code>
|
||||
or
|
||||
<code>--native</code>
|
||||
<dd>Use native HDF5 datatypes when repacking.
|
||||
<br>
|
||||
(Default behavior is to use original file datatypes.)
|
||||
<br>
|
||||
<em>Note that this is a change in default behavior;
|
||||
prior to Release 1.6.6, <code>h5repack</code> generated
|
||||
files only with native datatypes.</em>
|
||||
<p>
|
||||
<dt><code>-L</code>
|
||||
or
|
||||
<code>--latest</code>
|
||||
<dd>Use latest version of the HDF5 file format.
|
||||
<p>
|
||||
<dt><code>-c</code> <em>max_compact_links</em>
|
||||
or
|
||||
<code>--compact</code>=<em>max_compact_links</em>
|
||||
<dd>Set the maximum number of links, <em>max_compact_links</em>,
|
||||
that can be stored in a group header message (compact format).
|
||||
<p>
|
||||
<dt><code>-d</code> <em>min_indexed_links</em>
|
||||
or
|
||||
<code>--indexed</code>=<em>min_indexed_links</em>
|
||||
<dd>Set the minimum number of links, <em>min_indexed_links</em>,
|
||||
in the indexed format.
|
||||
<p>
|
||||
<em>max_compact_links</em> and <em>min_indexed_links</em>
|
||||
are closely related and the first must be equal to or
|
||||
greater than the second.
|
||||
In the general case, however, performance will suffer,
|
||||
possibly dramatically, if they are equal;
|
||||
performance can be improved by tuning the gap between
|
||||
the two values to minimize unnecessary thrashing
|
||||
between the compact storage and indexed storage modes
|
||||
as group size waxes and wanes.
|
||||
The relationship between <em>max_compact_links</em> and
|
||||
<em>min_indexed_links</em> is most important when
|
||||
group sizes are highly dynamic; that relationship is much
|
||||
less important in files with a stable structure.
|
||||
Compact mode is space and performance-efficient when groups
|
||||
have small numbers of members;
|
||||
indexed mode requires slightly more storage space,
|
||||
but provides increasingly better performance as the
|
||||
number of members in each group increases.
|
||||
<p>
|
||||
<dt><code>-m</code> <em>size</em>
|
||||
or
|
||||
<code>--minimum</code>=<em>size</em>
|
||||
<dd>Apply filter(s) only to objects whose size in bytes is
|
||||
equal to or greater than <em>size</em>.
|
||||
<br>
|
||||
<em>size</em> must be an integer greater than one
|
||||
( <code>1</code> ).
|
||||
<p>
|
||||
<i>Default:</i>
|
||||
If no size is specified, a threshold of 1024 bytes is assumed.
|
||||
<p>
|
||||
<dt><code>-u</code> <em>file</em>
|
||||
or
|
||||
<code>--ublock</code>=<em>file</em>
|
||||
<dd>Specify name of file containing user block data to be added.
|
||||
<p>
|
||||
<dt><code>-b</code> <em>user_block_size</em>
|
||||
or
|
||||
<code>--block</code>=<em>user_block_size</em>
|
||||
<dd>Set size in bytes of user block to be added.
|
||||
<br>
|
||||
<em>user_block_size</em> must be <code>512</code> or greater
|
||||
and a power of <code>2</code>.
|
||||
<p>
|
||||
<i>Default:</i> <code>1024</code>
|
||||
<p>
|
||||
<dt><code>-M</code> <em>size</em>
|
||||
or
|
||||
<code>--metadata_block_size</code>=<em>size</em>
|
||||
<dd>Metadata block size to be used when <code>h5repack</code>
|
||||
calls <a href="RM_H5P.html#Property-SetMetaBlockSize">
|
||||
<code>H5Pset_meta_block_size</code></a>.
|
||||
<br>
|
||||
<em>size</em> must be a non-negative integer.
|
||||
<p>
|
||||
<dt><code>-t</code> <em>alignment_threshold</em>
|
||||
or
|
||||
<code>--threshold</code>=<em>alignment_threshold</em>
|
||||
<dd>Set threshold value for <code>H5Pset_alignment</code> call.
|
||||
<br>
|
||||
<em>alignment_threshold</em> must be an integer.
|
||||
<p>
|
||||
<dt><code>-a</code> <em>alignment</em>
|
||||
or
|
||||
<code>--alignment</code>=<em>alignment</em>
|
||||
<dd>Set alignment value for <code>H5Pset_alignment</code> call.
|
||||
<br>
|
||||
<em>alignment</em> must be a positive integer.
|
||||
<p>
|
||||
|
||||
<!-- NEW PAGE -->
|
||||
|
||||
<dt><code>-s</code> <em>min_size</em>[:<em>header_type</em>]
|
||||
or
|
||||
<code>--ssize</code>=<em>min_size</em>[:<em>header_type</em>]
|
||||
<dd>Set the minimum size of optionally specified types
|
||||
of shared object header messages.
|
||||
<p>
|
||||
<em>min_size</em> is the minimum size, in bytes, of a
|
||||
shared object header message. Header messages smaller than the
|
||||
specified size will not be shared.
|
||||
<p>
|
||||
<em>header_type</em> specifies the type(s) of header message that
|
||||
this minimum size is to be applied to.
|
||||
Valid values of <em>header_type</em> are any of the following:
|
||||
<br><code> dspace </code>
|
||||
for dataspace header messages
|
||||
<br><code> dtype </code>
|
||||
for datatype header messages
|
||||
<br><code> fill </code>
|
||||
for fill values
|
||||
<br><code> pline </code>
|
||||
for property list header messages
|
||||
<br><code> attr </code>
|
||||
for attribute header messages
|
||||
<br>If <em>header_type</em> is not specified,
|
||||
<em>min_size</em> will be applied to all header messages.
|
||||
<p>
|
||||
<dt><code>-f</code> <em>filter</em>
|
||||
or
|
||||
<code>--filter</code>=<em>filter</em>
|
||||
<dd>Filter type
|
||||
<p>
|
||||
<em>filter</em> is a string of the following format:
|
||||
<dir>
|
||||
<em>list_of_objects</em> : <em>name_of_filter</em>[=<em>filter_parameters</em>]
|
||||
<p>
|
||||
<em>list_of_objects</em> is a comma separated list of object
|
||||
names meaning apply the filter(s) only to those objects.
|
||||
If no object names are specified, the filter is applied to
|
||||
all objects.
|
||||
<p>
|
||||
<em>name_of_filter</em> can be one of the following:
|
||||
<br>
|
||||
<code>GZIP</code>, to apply the HDF5 GZIP filter
|
||||
(GZIP compression)
|
||||
<br>
|
||||
<code>SZIP</code>, to apply the HDF5 SZIP filter
|
||||
(SZIP compression)
|
||||
<br>
|
||||
<code>SHUF</code>, to apply the HDF5 shuffle filter
|
||||
<br>
|
||||
<code>FLET</code>, to apply the HDF5 checksum filter
|
||||
<br>
|
||||
<code>NBIT</code>, to apply the HDF5 N-bit filter
|
||||
<br>
|
||||
<code>SOFF</code>, to apply the HDF5 scale/offset filter
|
||||
<br>
|
||||
<code>UD</code>, to apply a user-defined filter
|
||||
<br>
|
||||
<code>NONE</code>, to remove any filter(s)
|
||||
<p>
|
||||
<em>filter_parameters</em> conveys optional compression
|
||||
information:
|
||||
<br>
|
||||
<code>GZIP=</code><em>deflation_level</em> from 1-9
|
||||
<br>
|
||||
<code>SZIP=</code><em>pixels_per_block,coding_method</em>
|
||||
<br>
|
||||
<em>pixels_per_block</em> is a even number
|
||||
in the range 2-32.
|
||||
<br>
|
||||
<em>coding_method</em> is
|
||||
<code>EC</code> or <code>NN</code>.
|
||||
<br>
|
||||
<code>SHUF</code> (no parameter)
|
||||
<br>
|
||||
<code>FLET</code> (no parameter)
|
||||
<br>
|
||||
<code>NBIT</code> (no parameter)
|
||||
<br>
|
||||
<code>SOFF=</code><em>scale_factor,scale_type</em>
|
||||
<br>
|
||||
<em>scale_factor</em> is an integer.
|
||||
<br>
|
||||
<em>scale_type</em> is either <code>IN</code> or
|
||||
<code>DS</code>.
|
||||
<br>
|
||||
<code>UD=</code><em>filter_id,nfilter_params,value_1[,value_2,....,value_n]</em>
|
||||
<br>
|
||||
<em>filter_id</em> is the filter identifier.
|
||||
<br>
|
||||
<em>nfilter_params</em> is the number of filter parameters.
|
||||
<br>
|
||||
<em>value_1</em> through <em>value_n</em> are the values
|
||||
of each filter parameter.
|
||||
<br>
|
||||
Number of values must match the value of
|
||||
<em>nfilter_params</em>.
|
||||
<br>
|
||||
<code>NONE</code> (no parameter)
|
||||
</dir>
|
||||
<p>
|
||||
|
||||
<!-- NEW PAGE -->
|
||||
|
||||
<dt><code>-l</code> <em>layout</em>
|
||||
or
|
||||
<code>--layout</code>=<em>layout</em>
|
||||
<dd>Layout type
|
||||
<p>
|
||||
<em>layout</em> is a string of the following format:<br>
|
||||
<dir>
|
||||
<em>list_of_objects</em> : <em>layout_type</em>[=<em>layout_parameters</em>]
|
||||
<p>
|
||||
<em>list_of_objects</em> is a comma separated list of object
|
||||
names, meaning that layout information is supplied for those
|
||||
objects. If no object names are specified, the layout
|
||||
is applied to all objects.
|
||||
<p>
|
||||
<em>layout_type</em> can be one of the following:
|
||||
<br>
|
||||
<code>CHUNK</code>, to apply chunking layout
|
||||
<br>
|
||||
<code>COMPA</code>, to apply compact layout
|
||||
<br>
|
||||
<code>CONTI</code>, to apply contiguous layout
|
||||
<p>
|
||||
<em>layout_parameters</em> is present only in the
|
||||
<code>CHUNK</code> case and specifies the chunk size of
|
||||
each dimension in the following format with no intervening
|
||||
spaces:
|
||||
<br>
|
||||
<code><em>dim_1</em> × <em>dim_2</em> × ...
|
||||
<em>dim_n</em></code>
|
||||
</dd>
|
||||
</dir>
|
||||
<p>
|
||||
<dt><code>-e</code> <em>file</em>
|
||||
or
|
||||
<code>--file</code>=<em>file</em>
|
||||
<dd>File containing values to be passed in for the
|
||||
<code>-f</code> (or <code>--filter</code>) and
|
||||
<code>-l</code> (or <code>--layout</code>) options.
|
||||
<br>
|
||||
This file contains only the filter and layout flags.
|
||||
<p>
|
||||
|
||||
<dt><code>-S</code> <em>fs_strategy</em>
|
||||
or
|
||||
<code>--fs_strategy</code>=<em>fs_strategy</em>
|
||||
<dd>The type of file space management strategy to use for the
|
||||
output file
|
||||
<p>
|
||||
<em>fs_strategy</em> is a string as listed below:
|
||||
<br>
|
||||
<code>ALL_PERSIST</code>: Use persistent free-space
|
||||
managers, aggregators and virtual file
|
||||
driver for file space allocation
|
||||
<br>
|
||||
<code>ALL</code>: Use non-persistent free-space managers,
|
||||
aggregators and virtual file driver for file space
|
||||
allocation
|
||||
<br>
|
||||
<code>AGGR_VFD</code>: Use aggregators and virtual file
|
||||
driver for file space allocation
|
||||
<br>
|
||||
<code>VFD</code>: Use virtual file driver for
|
||||
file space allocation
|
||||
<p>
|
||||
|
||||
<dt><code>-T</code> <em>fs_threshold</em>
|
||||
or
|
||||
<code>--fs_threshold</code>=<em>fs_threshold</em>
|
||||
<dd>The free-space section threshold to use for the output file.
|
||||
<p>
|
||||
<em>fs_threshold</em> is the minimum size (in bytes) of
|
||||
free-space sections to be tracked by
|
||||
the library's free-space managers.
|
||||
<p>
|
||||
|
||||
<dt>The following are CCP options:
|
||||
<dt><code>-B</code> <em>S</em>
|
||||
or
|
||||
<code>--buf_size</code>=<em>S</em>
|
||||
<dd>memory buffer size[268435456]
|
||||
<p>
|
||||
|
||||
<dt><code>-C</code> <em>S</em>
|
||||
or
|
||||
<code>--cache_size</code>=<em>S</em>
|
||||
<dd>Raw data chunk cache size in bytes
|
||||
<p>
|
||||
|
||||
<dt><code>-O
|
||||
or
|
||||
<code>--no-h5ocopy</code>
|
||||
<dd>Do not use H5Ocopy at all [use]
|
||||
<p>
|
||||
|
||||
<dt><code>-R
|
||||
or
|
||||
<code>--readonly</code>
|
||||
<dd>Read only, no create or write output [off]
|
||||
<p>
|
||||
|
||||
<dt><code>-W
|
||||
or
|
||||
<code>-showtime</code>
|
||||
<dd>Show wall clock time [off]
|
||||
<p>
|
||||
|
||||
<dt><em>in_file</em>
|
||||
<dd>Input HDF5 file
|
||||
<p>
|
||||
<dt><em>out_file</em>
|
||||
<dd>Output HDF5 file
|
||||
</dl>
|
||||
|
||||
<p>
|
||||
<dt><strong>Exit Status:</strong></dt>
|
||||
<dd><table border=0>
|
||||
<tr valign=top align=left>
|
||||
<td>0</td>
|
||||
<td>Succeeded.</td>
|
||||
</tr>
|
||||
<tr valign=top align=left>
|
||||
<td>>0 </td>
|
||||
<td>An error occurred.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<dt><strong>Examples:</strong>
|
||||
<dd>
|
||||
<ol>
|
||||
<li><code>h5repack -f GZIP=1 -v file1 file2 </code>
|
||||
<br>
|
||||
Applies GZIP compression to all objects in <code>file1</code>
|
||||
and saves the output in <code>file2</code>.
|
||||
Prints verbose output.
|
||||
<br>
|
||||
<li><code>h5repack -f dset1:SZIP=8,NN file1 file2 </code>
|
||||
<br>
|
||||
Applies SZIP compression only to object <code>dset1</code>.
|
||||
<br>
|
||||
<li><code>h5repack -l dset1,dset2:CHUNK=20x10 file1 file2</code>
|
||||
<br>
|
||||
Applies chunked layout to objects <code>dset1</code>
|
||||
and <code>dset2</code>.
|
||||
<br>
|
||||
<li><code>h5repack -f UD=307,1,9 file1 file2</code>
|
||||
<br>
|
||||
Adds <code>bzip2</code> filter to all datasets.
|
||||
<br>
|
||||
</ol>
|
||||
|
||||
<p>
|
||||
<dt><strong>History:</strong>
|
||||
<dd><table width="90%">
|
||||
<tr>
|
||||
<td valign="top" align="left" width="10%">
|
||||
<strong>Release</strong> </td>
|
||||
<td valign="top" align="left">
|
||||
<strong>Change</strong></td></tr>
|
||||
<tr>
|
||||
<td valign="top">1.8.12</td>
|
||||
<td valign="top">
|
||||
Added user-defined filter parameter (<code>UD</code>) to
|
||||
<code>-f <i>filter</i></code>, <code>--filter=<i>filter</i></code>
|
||||
option for use in read and write operations.</td></tr>
|
||||
<tr>
|
||||
<td valign="top">1.8.9</td>
|
||||
<td valign="top">
|
||||
<code>-M <i>number</i>, --medata_block_size=<i>number</i></code>
|
||||
option introduced in this release.</td></tr>
|
||||
<tr>
|
||||
<td valign="top">1.8.1</td>
|
||||
<td valign="top">
|
||||
Original syntax restored; both the new and the original syntax
|
||||
are now supported.</td></tr>
|
||||
<tr>
|
||||
<td valign="top">1.8.0</td>
|
||||
<td valign="top">
|
||||
<code>h5repack</code> command line syntax changed in this
|
||||
release.</td></tr>
|
||||
<tr>
|
||||
<td valign="top">1.6.2</td>
|
||||
<td valign="top">
|
||||
<code>h5repack</code> introduced in this release.</td></tr>
|
||||
</table></dd>
|
||||
</dl>
|
||||
|
||||
|
||||
@@ -778,6 +778,7 @@ static int check_options(pack_opt_t *options) {
|
||||
*/
|
||||
static int check_objects(const char* fname, pack_opt_t *options) {
|
||||
hid_t fid;
|
||||
hid_t fapl = H5P_DEFAULT;
|
||||
unsigned int i;
|
||||
trav_table_t *travt = NULL;
|
||||
|
||||
@@ -785,11 +786,24 @@ static int check_objects(const char* fname, pack_opt_t *options) {
|
||||
if (options->op_tbl->nelems == 0)
|
||||
return 0;
|
||||
|
||||
if (options->cache_size){ /* need to set cache size for file access property lists */
|
||||
if (fapl==H5P_DEFAULT){
|
||||
if ((fapl = H5Pcreate (H5P_FILE_ACCESS)) < 0){
|
||||
error_msg("file access property list creation failed\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (options_set_cache(fapl, options->cache_size) < 0){
|
||||
error_msg("input file cache size setting failed\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* open the file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0))
|
||||
if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, fapl, NULL, NULL, 0))
|
||||
< 0) {
|
||||
printf("<%s>: %s\n", fname, H5FOPENERROR);
|
||||
return -1;
|
||||
@@ -882,11 +896,15 @@ static int check_objects(const char* fname, pack_opt_t *options) {
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (fapl > 0)
|
||||
H5Pclose(fapl);
|
||||
H5Fclose(fid);
|
||||
trav_table_free(travt);
|
||||
return 0;
|
||||
|
||||
out:
|
||||
if (fapl > 0)
|
||||
H5Pclose(fapl);
|
||||
H5Fclose(fid);
|
||||
trav_table_free(travt);
|
||||
return -1;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include "H5private.h"
|
||||
#include "hdf5.h"
|
||||
#include "h5trav.h"
|
||||
#include "io_timer.h"
|
||||
|
||||
#define H5FOPENERROR "unable to open file"
|
||||
#define PFORMAT "%-7s %-7s %-7s\n" /* chunk info, compression info, name*/
|
||||
@@ -30,6 +31,13 @@
|
||||
#define FORMAT_OBJ_ATTR " %-27s %s\n" /* obj type, name */
|
||||
#define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */
|
||||
|
||||
/* This is used to set file wide raw data cache size.
|
||||
* Copied from src/H5Fprivate.h. Remove when the information is made public.
|
||||
*/
|
||||
#ifndef H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME
|
||||
#define H5F_ACS_DATA_CACHE_BYTE_SIZE_NAME "rdcc_nbytes" /* Size of raw data chunk cache(bytes) */
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* data structures for command line options
|
||||
*-------------------------------------------------------------------------
|
||||
@@ -95,28 +103,33 @@ typedef struct {
|
||||
|
||||
/* all the above, ready to go to the hrepack call */
|
||||
typedef struct {
|
||||
pack_opttbl_t *op_tbl; /*table with all -c and -f options */
|
||||
int all_layout; /*apply the layout to all objects */
|
||||
int all_filter; /*apply the filter to all objects */
|
||||
filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */
|
||||
int n_filter_g; /*number of global filters */
|
||||
chunk_info_t chunk_g; /*global chunk INFO for the ALL case */
|
||||
H5D_layout_t layout_g; /*global layout information for the ALL case */
|
||||
int verbose; /*verbose mode */
|
||||
hsize_t min_comp; /*minimum size to compress, in bytes */
|
||||
int use_native; /*use a native type in write */
|
||||
int latest; /*pack file with the latest file format */
|
||||
int grp_compact; /* Set the maximum number of links to store as header messages in the group */
|
||||
int grp_indexed; /* Set the minimum number of links to store in the indexed format */
|
||||
int msg_size[8]; /* Minimum size of shared messages: dataspace,
|
||||
datatype, fill value, filter pipleline, attribute */
|
||||
const char *ublock_filename; /* user block file name */
|
||||
hsize_t ublock_size; /* user block size */
|
||||
hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */
|
||||
hsize_t threshold; /* alignment threshold for H5Pset_alignment */
|
||||
hsize_t alignment ; /* alignment for H5Pset_alignment */
|
||||
H5F_file_space_type_t fs_strategy; /* File space handling strategy */
|
||||
hsize_t fs_threshold; /* Free space section threshold */
|
||||
pack_opttbl_t *op_tbl; /*table with all -c and -f options */
|
||||
int all_layout; /*apply the layout to all objects */
|
||||
int all_filter; /*apply the filter to all objects */
|
||||
filter_info_t filter_g[H5_REPACK_MAX_NFILTERS]; /*global filter array for the ALL case */
|
||||
int n_filter_g; /*number of global filters */
|
||||
chunk_info_t chunk_g; /*global chunk INFO for the ALL case */
|
||||
H5D_layout_t layout_g; /*global layout information for the ALL case */
|
||||
int verbose; /*verbose mode */
|
||||
hsize_t min_comp; /*minimum size to compress, in bytes */
|
||||
int use_native; /*use a native type in write */
|
||||
int latest; /*pack file with the latest file format */
|
||||
int grp_compact; /* Set the maximum number of links to store as header messages in the group */
|
||||
int grp_indexed; /* Set the minimum number of links to store in the indexed format */
|
||||
int msg_size[8]; /* Minimum size of shared messages: dataspace,
|
||||
datatype, fill value, filter pipleline, attribute */
|
||||
size_t buf_size; /* raw data memory buffer size in bytes */
|
||||
size_t cache_size; /* file wide raw data chunk cache size in bytes */
|
||||
int no_h5ocopy; /* read only, do not create or write to output file */
|
||||
int readonly; /* read only, do not create or write to output file */
|
||||
const char *ublock_filename; /* user block file name */
|
||||
hsize_t ublock_size; /* user block size */
|
||||
hsize_t meta_block_size; /* metadata aggregation block size (for H5Pset_meta_block_size) */
|
||||
hsize_t threshold; /* alignment threshold for H5Pset_alignment */
|
||||
hsize_t alignment ; /* alignment for H5Pset_alignment */
|
||||
H5F_file_space_type_t fs_strategy; /* File space handling strategy */
|
||||
hsize_t fs_threshold; /* Free space section threshold */
|
||||
int showtime; /* show wall clock time */
|
||||
} pack_opt_t;
|
||||
|
||||
|
||||
@@ -218,6 +231,8 @@ int options_add_filter ( obj_list_t *obj_list,
|
||||
pack_opttbl_t *table );
|
||||
pack_info_t* options_get_object( const char *path,
|
||||
pack_opttbl_t *table);
|
||||
int options_set_cache (hid_t plist_id,
|
||||
size_t rdcc_nbytes);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* parse functions
|
||||
|
||||
@@ -104,12 +104,40 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
hsize_t ub_size = 0; /* size of user block */
|
||||
hid_t fcpl = H5P_DEFAULT; /* file creation property list ID */
|
||||
hid_t fapl = H5P_DEFAULT; /* file access property list ID */
|
||||
io_time_t *filecopytime = NULL;
|
||||
int readonly;
|
||||
|
||||
/* local variable initialization */
|
||||
readonly = options->readonly;
|
||||
|
||||
/* process option requests */
|
||||
if (options->cache_size){ /* need to set cache size for file access property lists */
|
||||
if (fapl==H5P_DEFAULT){
|
||||
if ((fapl = H5Pcreate (H5P_FILE_ACCESS)) < 0){
|
||||
error_msg("file access property list creation failed\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
if (options_set_cache(fapl, options->cache_size) < 0){
|
||||
error_msg("input file cache size setting failed\n");
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
if (options->showtime){ /* need to keep track of time */
|
||||
if (NULL == (filecopytime = io_time_new(SYS_CLOCK))){
|
||||
error_msg("io timer new failed\n");
|
||||
goto out;
|
||||
}
|
||||
/* start timer */
|
||||
set_time(filecopytime, HDF5_FILE_OPENCLOSE, TSTART);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* open input file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL,
|
||||
if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, fapl, NULL, NULL,
|
||||
(size_t) 0)) < 0) {
|
||||
error_msg("<%s>: %s\n", fnamein, H5FOPENERROR);
|
||||
goto out;
|
||||
@@ -225,19 +253,20 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
} /* end for */
|
||||
} /* if (nindex>0) */
|
||||
|
||||
/* Create file access property list */
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
||||
error_msg("Could not create file access property list\n");
|
||||
goto out;
|
||||
} /* end if */
|
||||
/* Create file access property list if fapl is not already created */
|
||||
if (fapl==H5P_DEFAULT){
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
||||
error_msg("Could not create file access property list\n");
|
||||
goto out;
|
||||
} /* end if */
|
||||
}
|
||||
|
||||
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
|
||||
error_msg(
|
||||
"Could not set property for using latest version of the format\n");
|
||||
error_msg("Could not set property for using latest version of the format\n");
|
||||
goto out;
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* end if (options->latest) */
|
||||
} /* end if (options->latest || ub_size > 0) */
|
||||
#if defined (H5REPACK_DEBUG_USER_BLOCK)
|
||||
print_user_block(fnamein, fidin);
|
||||
#endif
|
||||
@@ -330,6 +359,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
if (options->verbose)
|
||||
printf("Making file <%s>...\n", fnameout);
|
||||
|
||||
if (!readonly)
|
||||
if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
|
||||
error_msg("<%s>: Could not create file\n", fnameout);
|
||||
goto out;
|
||||
@@ -339,6 +369,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
* write a new user block if requested
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (!readonly)
|
||||
if (options->ublock_size > 0) {
|
||||
if (copy_user_block(options->ublock_filename, fnameout,
|
||||
options->ublock_size) < 0) {
|
||||
@@ -374,6 +405,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
* and create hard links
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (!readonly)
|
||||
if (do_copy_refobjs(fidin, fidout, travt, options) < 0) {
|
||||
printf("h5repack: <%s>: Could not copy data to: %s\n", fnamein,
|
||||
fnameout);
|
||||
@@ -392,8 +424,18 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
H5Pclose(fcpl);
|
||||
|
||||
H5Fclose(fidin);
|
||||
if (!readonly)
|
||||
H5Fclose(fidout);
|
||||
|
||||
/* stop timer and time if requested */
|
||||
if (filecopytime){
|
||||
double xwt;
|
||||
set_time(filecopytime, HDF5_FILE_OPENCLOSE, TSTOP);
|
||||
xwt = get_time(filecopytime, HDF5_FILE_OPENCLOSE);
|
||||
printf("Total file copy time = %.2lfm(%.0lfs)\n", xwt/60.0, xwt);
|
||||
io_time_destroy(filecopytime);
|
||||
}
|
||||
|
||||
/* free table */
|
||||
trav_table_free(travt);
|
||||
travt = NULL;
|
||||
@@ -403,6 +445,7 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (!readonly)
|
||||
if (ub_size > 0 && options->ublock_size == 0) {
|
||||
if (copy_user_block(fnamein, fnameout, ub_size) < 0) {
|
||||
error_msg("Could not copy user block. Exiting...\n");
|
||||
@@ -424,13 +467,14 @@ out:
|
||||
H5Pclose(fapl);
|
||||
H5Pclose(fcpl);
|
||||
H5Fclose(fidin);
|
||||
if (!readonly)
|
||||
H5Fclose(fidout);
|
||||
}H5E_END_TRY;
|
||||
if (travt)
|
||||
trav_table_free(travt);
|
||||
|
||||
return -1;
|
||||
}
|
||||
} /* copy_objects */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: Get_hyperslab
|
||||
@@ -730,6 +774,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
htri_t is_named;
|
||||
hbool_t limit_maxdims;
|
||||
hsize_t size_dset;
|
||||
int readonly;
|
||||
|
||||
/* local variable initialization */
|
||||
readonly = options->readonly;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* copy the suppplied object list
|
||||
@@ -757,7 +805,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_GROUP:
|
||||
{
|
||||
|
||||
if (readonly)
|
||||
break;
|
||||
if (options->verbose) {
|
||||
printf(FORMAT_OBJ, "group", travt->objs[i].name);
|
||||
}
|
||||
@@ -823,12 +874,14 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
goto error;
|
||||
|
||||
break;
|
||||
} /* case H5TRAV_TYPE_GROUP */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_DATASET
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_DATASET:
|
||||
{
|
||||
|
||||
has_filter = 0;
|
||||
req_filter = 0;
|
||||
@@ -874,6 +927,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
if ((is_named = H5Tcommitted(ftype_id)) < 0)
|
||||
goto error;
|
||||
if (is_named)
|
||||
if (!readonly)
|
||||
if ((wtype_id = copy_named_datatype(ftype_id, fidout,
|
||||
&named_dt_head, travt, options)) < 0)
|
||||
goto error;
|
||||
@@ -889,7 +943,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
* otherwise we do a copy using H5Ocopy
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (options->op_tbl->nelems || options->all_filter == 1
|
||||
if (options->no_h5ocopy || options->op_tbl->nelems || options->all_filter == 1
|
||||
|| options->all_layout == 1 || is_ref || is_named) {
|
||||
|
||||
int j;
|
||||
@@ -1009,6 +1063,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
* modified dcpl; in that case use the original instead
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (!readonly){
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
dset_out = H5Dcreate2(fidout,
|
||||
@@ -1029,6 +1084,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
goto error;
|
||||
apply_f = 0;
|
||||
}
|
||||
} /* (!readonly) */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* read/write
|
||||
@@ -1036,15 +1092,17 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
*/
|
||||
if (nelmts > 0 && space_status != H5D_SPACE_STATUS_NOT_ALLOCATED) {
|
||||
size_t need = (size_t)(nelmts * msize); /* bytes needed */
|
||||
|
||||
if (options->showtime && options->verbose)
|
||||
printf("memory buffer size needed=%lu\n", (unsigned long)need);;
|
||||
/* have to read the whole dataset if there is only one element in the dataset */
|
||||
if (need < H5TOOLS_MALLOCSIZE)
|
||||
if (need <= H5TOOLS_MALLOCSIZE)
|
||||
buf = HDmalloc(need);
|
||||
|
||||
if (buf != NULL) {
|
||||
/* read/write: use the macro to check error, e.g. memory allocation error inside the library. */
|
||||
CHECK_H5DRW_ERROR(H5Dread, dset_in, wtype_id,
|
||||
H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
if (!readonly)
|
||||
CHECK_H5DRW_ERROR(H5Dwrite, dset_out, wtype_id,
|
||||
H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
|
||||
@@ -1142,6 +1200,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
CHECK_H5DRW_ERROR(H5Dread, dset_in,
|
||||
wtype_id, hslab_space, f_space_id,
|
||||
H5P_DEFAULT, hslab_buf);
|
||||
if (!readonly)
|
||||
CHECK_H5DRW_ERROR(H5Dwrite, dset_out,
|
||||
wtype_id, hslab_space, f_space_id,
|
||||
H5P_DEFAULT, hslab_buf);
|
||||
@@ -1221,6 +1280,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
options) < 0)
|
||||
goto error;
|
||||
/*close */
|
||||
if (!readonly)
|
||||
if (H5Dclose(dset_out) < 0)
|
||||
goto error;
|
||||
|
||||
@@ -1252,6 +1312,8 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
else {
|
||||
hid_t pid;
|
||||
|
||||
if (options->showtime && options->verbose)
|
||||
printf("using h5ocopy to copy %s\n", travt->objs[i].name);
|
||||
/* create property to pass copy options */
|
||||
if ((pid = H5Pcreate(H5P_OBJECT_COPY)) < 0)
|
||||
goto error;
|
||||
@@ -1301,12 +1363,16 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
} /* end do we have request for filter/chunking */
|
||||
|
||||
break;
|
||||
} /*case H5TRAV_TYPE_DATASET */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_NAMED_DATATYPE
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_NAMED_DATATYPE:
|
||||
{
|
||||
if (readonly)
|
||||
break;
|
||||
|
||||
if (options->verbose)
|
||||
printf(FORMAT_OBJ, "type", travt->objs[i].name);
|
||||
@@ -1339,6 +1405,7 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
goto error;
|
||||
|
||||
break;
|
||||
} /*case H5TRAV_TYPE_NAMED_DATATYPE */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_LINK
|
||||
@@ -1352,6 +1419,8 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
case H5TRAV_TYPE_LINK:
|
||||
case H5TRAV_TYPE_UDLINK: {
|
||||
|
||||
if (readonly)
|
||||
break;
|
||||
if (options->verbose)
|
||||
printf(FORMAT_OBJ, "link", travt->objs[i].name);
|
||||
|
||||
@@ -1362,8 +1431,8 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
if (options->verbose)
|
||||
printf(FORMAT_OBJ, "link", travt->objs[i].name);
|
||||
|
||||
}
|
||||
break;
|
||||
} /* case H5TRAV_TYPE_LINK and case H5TRAV_TYPE_UDLINK */
|
||||
|
||||
default:
|
||||
goto error;
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#define PROGRAMNAME "h5repack"
|
||||
|
||||
static int parse_command_line(int argc, const char **argv, pack_opt_t* options);
|
||||
static void dump_options(const pack_opt_t* options);
|
||||
static void leave(int ret) NORETURN;
|
||||
|
||||
|
||||
@@ -33,7 +34,7 @@ const char *outfile = NULL;
|
||||
* Command-line options: The user can specify short or long-named
|
||||
* parameters.
|
||||
*/
|
||||
static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:S:T:";
|
||||
static const char *s_opts = "hVvf:l:m:e:nLc:d:s:u:b:M:t:a:i:o:B:C:ORS:T:W";
|
||||
static struct long_options l_opts[] = {
|
||||
{ "help", no_arg, 'h' },
|
||||
{ "version", no_arg, 'V' },
|
||||
@@ -54,8 +55,13 @@ static struct long_options l_opts[] = {
|
||||
{ "alignment", require_arg, 'a' },
|
||||
{ "infile", require_arg, 'i' }, /* -i for backward compability */
|
||||
{ "outfile", require_arg, 'o' }, /* -o for backward compability */
|
||||
{ "buf_size", require_arg, 'B' },/* memory buffer size */
|
||||
{ "cache_size", require_arg, 'C' },
|
||||
{ "no-h5ocopy", no_arg, 'O' },
|
||||
{ "readonly", no_arg, 'R' },
|
||||
{ "fs_strategy", require_arg, 'S' },
|
||||
{ "fs_threshold", require_arg, 'T' },
|
||||
{ "showtime", no_arg, 'W' }, /* show wall clock time */
|
||||
{ NULL, 0, '\0' }
|
||||
};
|
||||
|
||||
@@ -90,8 +96,13 @@ static void usage(const char *prog) {
|
||||
printf(" -a A, --alignment=A Alignment value for H5Pset_alignment\n");
|
||||
printf(" -f FILT, --filter=FILT Filter type\n");
|
||||
printf(" -l LAYT, --layout=LAYT Layout type\n");
|
||||
printf(" -B S, --buf_size=S memory buffer size[%llu]\n", H5TOOLS_MALLOCSIZE);
|
||||
printf(" -C S, --cache_size=S Raw data chunk cache size in bytes\n");
|
||||
printf(" -O, --no-h5ocopy Do not use H5Ocopy at all [use]\n");
|
||||
printf(" -R, --readonly Read only, no create or write output [off]\n");
|
||||
printf(" -S FS_STRGY, --fs_strategy=FS_STRGY File space management strategy\n");
|
||||
printf(" -T FS_THRD, --fs_threshold=FS_THRD Free-space section threshold\n");
|
||||
printf(" -W, --showtime Show wall clock time [off]\n");
|
||||
printf("\n");
|
||||
printf(" M - is an integer greater than 1, size of dataset in bytes (default is 0) \n");
|
||||
printf(" E - is a filename.\n");
|
||||
@@ -191,7 +202,7 @@ static void usage(const char *prog) {
|
||||
printf("\n");
|
||||
printf(" Add bzip2 filter to all datasets\n");
|
||||
printf("\n");
|
||||
}
|
||||
} /* usage */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: leave
|
||||
@@ -211,7 +222,7 @@ static void leave(int ret) {
|
||||
h5tools_close();
|
||||
|
||||
HDexit(ret);
|
||||
}
|
||||
} /* leave */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: read_info
|
||||
@@ -334,7 +345,7 @@ done:
|
||||
HDfclose(fp);
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
} /* read_info */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: parse_command_line
|
||||
@@ -477,6 +488,21 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) {
|
||||
options->ublock_filename = opt_arg;
|
||||
break;
|
||||
|
||||
case 'B':
|
||||
options->buf_size = (size_t) HDatol( opt_arg );
|
||||
if (options->buf_size == 0) {
|
||||
error_msg("invalid memory buffer size(%s)\n", opt_arg);
|
||||
h5tools_setstatus(EXIT_FAILURE);
|
||||
ret_value = -1;
|
||||
goto done;
|
||||
}
|
||||
H5TOOLS_BUFSIZE = H5TOOLS_MALLOCSIZE = options->buf_size;
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
options->cache_size = (size_t) HDatol( opt_arg );
|
||||
break;
|
||||
|
||||
case 'b':
|
||||
options->ublock_size = (hsize_t) HDatol( opt_arg );
|
||||
break;
|
||||
@@ -499,6 +525,14 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) {
|
||||
}
|
||||
break;
|
||||
|
||||
case 'O':
|
||||
options->no_h5ocopy++;
|
||||
break;
|
||||
|
||||
case 'R':
|
||||
options->readonly++;
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
{
|
||||
char strategy[MAX_NC_NAME];
|
||||
@@ -525,6 +559,10 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) {
|
||||
options->fs_threshold = (hsize_t) HDatol( opt_arg );
|
||||
break;
|
||||
|
||||
case 'W':
|
||||
options->showtime++;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
} /* switch */
|
||||
@@ -542,7 +580,40 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options) {
|
||||
}
|
||||
|
||||
done:
|
||||
return ret_value;
|
||||
/* clean up */
|
||||
/* nothing to clean yet */
|
||||
|
||||
return ret_value;
|
||||
} /* parse_command_line */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: dump_options
|
||||
*
|
||||
* Purpose: display some (all?) option values
|
||||
*
|
||||
* Return: void
|
||||
*
|
||||
* Failure: not expected
|
||||
*
|
||||
* Programmer: Albert Cheng
|
||||
*
|
||||
* Date: Jan 10, 2015
|
||||
*
|
||||
* Comments:
|
||||
*-----------------------------------------------------------------------*/
|
||||
static void
|
||||
dump_options(const pack_opt_t* options){
|
||||
/* for now only display options related to performance */
|
||||
printf("showtime=%d\n", options->showtime);
|
||||
printf("input file=%s\n", infile);
|
||||
printf("output file=%s\n", outfile);
|
||||
printf("no-h5ocopy=%d\n", options->no_h5ocopy);
|
||||
printf("readonly=%d\n", options->readonly);
|
||||
printf("cache_size=%lu\n", (unsigned long)options->cache_size);
|
||||
printf("buf_size=%lu (H5TOOLS_BUFSIZE=%llu, H5TOOLS_MALLOCSIZE=%llu) \n",
|
||||
(unsigned long)options->buf_size, H5TOOLS_BUFSIZE, H5TOOLS_MALLOCSIZE);
|
||||
/* flush output so that interactive user may see the output at once. */
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@@ -606,6 +677,10 @@ int main(int argc, const char **argv) {
|
||||
}
|
||||
}
|
||||
|
||||
/* show all option values when time statistics is requested */
|
||||
if (options.showtime)
|
||||
dump_options(&options);
|
||||
|
||||
/* pack it */
|
||||
h5tools_setstatus(h5repack(infile, outfile, &options));
|
||||
|
||||
|
||||
@@ -367,3 +367,39 @@ pack_info_t* options_get_object(const char *path, pack_opttbl_t *table) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: options_set_cache
|
||||
*
|
||||
* Purpose: set the file chunk cache size
|
||||
*
|
||||
* Parameters:
|
||||
* fpal: File Acccess Property list
|
||||
* rdcc_nbytes: Raw Data Chunk cache size in bytes
|
||||
*
|
||||
* Return: 0 succeeds, -1 else.
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int options_set_cache (hid_t fapl, size_t rdcc_nbytes)
|
||||
{
|
||||
/* Dummy variables */
|
||||
size_t rdcc_nelmts;
|
||||
double w0;
|
||||
|
||||
/* sanity check */
|
||||
HDassert(fapl != H5P_DEFAULT);
|
||||
HDassert(H5Pequal(H5Pget_class(fapl), H5P_FILE_ACCESS) > 0);
|
||||
|
||||
|
||||
/* retrieve current values of rdcc_nelmts and w0 to reapply them together */
|
||||
/* with the new values of rdcc_nbytes */
|
||||
if (H5Pget_cache (fapl, NULL, &rdcc_nelmts, NULL, &w0) < 0){
|
||||
error_msg("internal call of get cache failed\n");
|
||||
return -1;
|
||||
}
|
||||
if (H5Pset_cache (fapl, 0, rdcc_nelmts, rdcc_nbytes, w0) < 0){
|
||||
error_msg("input file cache size setting failed\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -19,8 +19,13 @@ usage: h5repack [OPTIONS] file1 file2
|
||||
-a A, --alignment=A Alignment value for H5Pset_alignment
|
||||
-f FILT, --filter=FILT Filter type
|
||||
-l LAYT, --layout=LAYT Layout type
|
||||
-B S, --buf_size=S memory buffer size[268435456]
|
||||
-C S, --cache_size=S Raw data chunk cache size in bytes
|
||||
-O, --no-h5ocopy Do not use H5Ocopy at all [use]
|
||||
-R, --readonly Read only, no create or write output [off]
|
||||
-S FS_STRGY, --fs_strategy=FS_STRGY File space management strategy
|
||||
-T FS_THRD, --fs_threshold=FS_THRD Free-space section threshold
|
||||
-W, --showtime Show wall clock time [off]
|
||||
|
||||
M - is an integer greater than 1, size of dataset in bytes (default is 0)
|
||||
E - is a filename.
|
||||
|
||||
Reference in New Issue
Block a user