summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-10-02 02:08:59 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-10-02 02:08:59 (GMT)
commit37ec6dc75e85ebd7f9fb9b32fe978e47ab3fe918 (patch)
tree387658306d99e60d807c2eb8b3888a12aca4a75f /tools/h5repack/h5repack_copy.c
parent006071f2338faa14f2784562279cb78b4341bce0 (diff)
downloadhdf5-37ec6dc75e85ebd7f9fb9b32fe978e47ab3fe918.zip
hdf5-37ec6dc75e85ebd7f9fb9b32fe978e47ab3fe918.tar.gz
hdf5-37ec6dc75e85ebd7f9fb9b32fe978e47ab3fe918.tar.bz2
[svn-r17582] Description:
Bring changes from file free space branch back to the trunk. *yay!* Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/default API=1.8.x, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers, w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in debug mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.8 (amazon) in debug mode Mac OS X/32 10.5.8 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r--tools/h5repack/h5repack_copy.c46
1 files changed, 45 insertions, 1 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index 0fb8fc8..77c03d2 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -104,7 +104,7 @@ int copy_objects(const char* fnamein,
goto out;
}
- /* get user block size */
+ /* get user block size and file space strategy/threshold */
{
hid_t fcpl_in; /* file creation property list ID for input file */
@@ -120,6 +120,24 @@ int copy_objects(const char* fnamein,
goto out;
}
+ if(!options->fs_strategy)
+ {
+ if(H5Pget_file_space(fcpl_in, &options->fs_strategy, NULL) < 0)
+ {
+ error_msg(progname, "failed to retrieve file space strategy\n");
+ goto out;
+ }
+ }
+
+ if(!options->fs_threshold)
+ {
+ if(H5Pget_file_space(fcpl_in, NULL, &options->fs_threshold) < 0)
+ {
+ error_msg(progname, "failed to retrieve file space threshold\n");
+ goto out;
+ }
+ }
+
if(H5Pclose(fcpl_in) < 0)
{
error_msg(progname, "failed to close property list\n");
@@ -316,6 +334,32 @@ int copy_objects(const char* fnamein,
}
+ /* either use the FCPL already created or create a new one */
+ if(fcpl != H5P_DEFAULT)
+ {
+ /* set file space strategy and free space threshold */
+ if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0)
+ {
+ error_msg(progname, "failed to set file space strategy & threshold\n");
+ goto out;
+ }
+ }
+ else
+ {
+ /* create a file creation property list */
+ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
+ {
+ error_msg(progname, "fail to create a file creation property list\n");
+ goto out;
+ }
+
+ /* set file space strategy and free space threshold */
+ if(H5Pset_file_space(fcpl, options->fs_strategy, options->fs_threshold) < 0)
+ {
+ error_msg(progname, "failed to set file space strategy & threshold \n");
+ goto out;
+ }
+ }
/*-------------------------------------------------------------------------
* create the output file