summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_copy.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2012-03-31 05:19:54 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2012-03-31 05:19:54 (GMT)
commit51da27de3bb95b6464ef7651fa68d92b616a634c (patch)
treef54b81f386b8decf1b5c467a3cb988eb7a583492 /tools/h5repack/h5repack_copy.c
parent0e573bd2406448e9380d15d17c41bb1d8b5300e7 (diff)
downloadhdf5-51da27de3bb95b6464ef7651fa68d92b616a634c.zip
hdf5-51da27de3bb95b6464ef7651fa68d92b616a634c.tar.gz
hdf5-51da27de3bb95b6464ef7651fa68d92b616a634c.tar.bz2
[svn-r22216] Description:
Bring r22180, r22181 and r22214 from trunk to 1.8 branch: Add new "metadata block size" command line option ('-M <x>' or '--metadata_block_size=<x>') for h5repack. [With release managers blessing] Tested on: Mac OSX/64 10.7.3 (amazon) w/debug) (h5committest upcoming)
Diffstat (limited to 'tools/h5repack/h5repack_copy.c')
-rw-r--r--tools/h5repack/h5repack_copy.c81
1 files changed, 31 insertions, 50 deletions
diff --git a/tools/h5repack/h5repack_copy.c b/tools/h5repack/h5repack_copy.c
index ff682a2..e8fbbfa 100644
--- a/tools/h5repack/h5repack_copy.c
+++ b/tools/h5repack/h5repack_copy.c
@@ -236,109 +236,90 @@ int copy_objects(const char* fnamein,
} /* end if */
} /* end if */
} /* end if */
-
-
-
-
#if defined (H5REPACK_DEBUG_USER_BLOCK)
- print_user_block(fnamein,fidin);
+ print_user_block(fnamein, fidin);
#endif
-
/*-------------------------------------------------------------------------
* set the new user userblock options in the FCPL (before H5Fcreate )
*-------------------------------------------------------------------------
*/
-
if ( options->ublock_size > 0 )
{
/* either use the FCPL already created or create a new one */
- if(fcpl != H5P_DEFAULT)
- {
- /* set user block size */
- if(H5Pset_userblock(fcpl, options->ublock_size) < 0)
- {
- error_msg("failed to set userblock size\n");
- goto out;
- }
-
- }
-
- else
+ if(fcpl == H5P_DEFAULT)
{
-
/* create a file creation property list */
if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
{
error_msg("fail to create a file creation property list\n");
goto out;
}
-
- /* set user block size */
- if(H5Pset_userblock(fcpl, options->ublock_size) < 0)
- {
- error_msg("failed to set userblock size\n");
- goto out;
- }
-
}
-
-
+ /* set user block size */
+ if(H5Pset_userblock(fcpl, options->ublock_size) < 0)
+ {
+ error_msg("failed to set userblock size\n");
+ goto out;
+ }
}
-
/*-------------------------------------------------------------------------
* set alignment options
*-------------------------------------------------------------------------
*/
-
-
if ( options->alignment > 0 )
{
/* either use the FAPL already created or create a new one */
- if (fapl != H5P_DEFAULT)
+ if (fapl == H5P_DEFAULT)
{
-
- if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0)
+ /* create a file access property list */
+ if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
{
- error_msg("failed to set alignment\n");
+ error_msg("Could not create file access property list\n");
goto out;
}
-
}
- else
+ if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0)
{
+ error_msg("failed to set alignment\n");
+ goto out;
+ }
+ }
+ /*-------------------------------------------------------------------------
+ * set metadata block size option
+ *-------------------------------------------------------------------------
+ */
+ if ( options->meta_block_size > 0 )
+ {
+ /* either use the FAPL already created or create a new one */
+ if (fapl == H5P_DEFAULT)
+ {
/* create a file access property list */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
{
error_msg("Could not create file access property list\n");
goto out;
}
-
- if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0)
- {
- error_msg("failed to set alignment\n");
- goto out;
- }
-
}
+ if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0)
+ {
+ error_msg("failed to set metadata block size\n");
+ goto out;
+ }
}
-
/*-------------------------------------------------------------------------
* create the output file
*-------------------------------------------------------------------------
*/
-
-
if(options->verbose)
printf("Making file <%s>...\n",fnameout);
-
if((fidout = H5Fcreate(fnameout,H5F_ACC_TRUNC, fcpl, fapl)) < 0)
{
error_msg("<%s>: Could not create file\n", fnameout );