First pass at repack consolidating external storage if layout given.

Checks out manually, tests still complain.
This commit is contained in:
Jacob Smith 2019-05-31 17:24:26 -05:00
parent cb6029196a
commit ad2a7f4789
4 changed files with 20 additions and 9 deletions

View File

@ -807,8 +807,17 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
if ((dcpl_in = H5Dget_create_plist(dset_in)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
if ((dcpl_out = H5Pcopy(dcpl_in)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed");
/* If the input dataset has external storage, it must be contiguous.
* Accordingly, there would be no filter or chunk properties to preserve.
*/
if (H5Pget_external_count(dcpl_in)) {
if ((dcpl_out = H5Pcreate(H5P_DATASET_CREATE)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed");
}
else {
if ((dcpl_out = H5Pcopy(dcpl_in)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcopy failed");
}
if ((rank = H5Sget_simple_extent_ndims(f_space_id)) < 0)
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
HDmemset(dims, 0, sizeof dims);
@ -1175,7 +1184,7 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
}
/*-------------------------------------------------------------------------
* we do not have request for filter/chunking use H5Ocopy instead
* we do not have request for filter/chunking; use H5Ocopy instead
*-------------------------------------------------------------------------
*/
else {

View File

@ -59,7 +59,8 @@ endif
# Temporary files. *.h5 are generated by h5repack. They should
# copied to the testfiles/ directory if update is required.
CHECK_CLEANFILES+=*.h5 *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
# *.dat files may be created by h5repackgentest.
CHECK_CLEANFILES+=*.h5 *.dat *.bin testfiles/h5diff_attr1.h5 testfiles/tfamily*.h5
DISTCLEANFILES=h5repack.sh h5repack_plugin.sh
include $(top_srcdir)/config/conclude.am

View File

@ -675,7 +675,8 @@ VERIFY_EXTERNAL_CONSOLIDATION()
)
# flag if any of the above checks failed
if [ $prev_nerrors != $nerrors ]; then
if [ $prev_nerrors != $nerrors ]
then
echo ". . . *FAILED*"
nerrors="`expr $prev_nerrors + 1`"
else

View File

@ -8,7 +8,7 @@
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
*/
static void
generate_external_int32le(hbool_t external)
generate_int32le(hbool_t external)
{
char filename[MAX_NAME_SIZE];
hid_t file;
@ -67,7 +67,7 @@ generate_external_int32le(hbool_t external)
HDassert(H5Dclose(dset) >= 0);
HDassert(H5Sclose(dspace) >= 0);
HDassert(H5Fclose(file) >= 0);
} /* end generate_external_int32le() */
} /* end generate_int32le() */
/* ----------------------------------------------------------------------------
@ -75,8 +75,8 @@ generate_external_int32le(hbool_t external)
int
main(void)
{
generate_external_int32le(FALSE);
generate_external_int32le(TRUE);
generate_int32le(FALSE);
generate_int32le(TRUE);
return 0;
} /* end main() */