diff options
author | jake.smith <jake.smith@hdfgroup.org> | 2018-12-29 20:31:31 (GMT) |
---|---|---|
committer | jake.smith <jake.smith@hdfgroup.org> | 2018-12-29 20:31:31 (GMT) |
commit | 905c3ca3d7736b151ff0889290c0c9e377988f26 (patch) | |
tree | 3b6d8b5ab846dcf0a29bf14460e5058096e78800 /src/H5F.c | |
parent | ba095e6a53a919c9753463c3800a26b180b7a135 (diff) | |
parent | f54fb420d08ea0a7e7b026150c0ab559803e0acd (diff) | |
download | hdf5-905c3ca3d7736b151ff0889290c0c9e377988f26.zip hdf5-905c3ca3d7736b151ff0889290c0c9e377988f26.tar.gz hdf5-905c3ca3d7736b151ff0889290c0c9e377988f26.tar.bz2 |
Merge pull request #1372 in HDFFV/hdf5 from ~JAKE.SMITH/hdf5:dset_ohdr_minimize to develop
Dataset object header minimization
Jira TRILAB-45
* commit 'f54fb420d08ea0a7e7b026150c0ab559803e0acd': (34 commits)
Specify variable type. Remove unnecessary whitespace.
OHDR tests now accept h5_fileaccess() fapls. Formatting, informative comments, and minor renaming.
Fix some CMake listings
Add error checking to the minimized dset header size calculation. Update printf->HDprintf statements.
Remove `#if 0` block of deprecated code.
Fix mistake with H5E_BEGIN_TRY {...} H5E_END_TRY block containing ERROR-raising macros. Formatting tweaks.
Add "compact" storage test to relative header size comparisons.
Formatting adjustments.
Formatting adjustments
Move H5Fset_dset_no_attrs_hint VOL operations to native. Move minimzied object header tests from separate file to test/ohdr.c Some formatting changes.
Re-format test/ohdr_mindset.c Fix a few transcription errors in other test files.
formatting adjustments
Reformat to be more consistent with existing code. Fix a few typos.
add missing paramter - macro seemingly unused, but absence results in compiler complaint
fix reference; move declaration in file
Remove unused debugging print in '#if 0' block
Fix typo. Fix CHECK of wrong ID (dset[2|3]_id).
change test file name and apply 'h5_fixname' to it
Sidestep and hide&flag minor issues causing test failures.
Incorporate minimized dset ohdr tests into extant suite.
...
Diffstat (limited to 'src/H5F.c')
-rw-r--r-- | src/H5F.c | 88 |
1 files changed, 87 insertions, 1 deletions
@@ -1335,7 +1335,7 @@ H5Fget_metadata_read_retry_info(hid_t file_id, H5F_retry_info_t *info) H5TRACE2("e", "i*x", file_id, info); /* Check args */ - if (!info) + if(!info) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no info struct") /* Get the file pointer */ @@ -1822,3 +1822,89 @@ done: FUNC_LEAVE_API(ret_value) } /* H5Fincrement_filesize() */ + +/*------------------------------------------------------------------------- + * Function: H5Fget_dset_no_attrs_hint + * + * Purpose: + * + * Get the file-level setting to create minimized dataset object headers. + * Result is stored at pointer `minimize`. + * + * Return: + * + * Success: SUCCEED (0) (non-negative value) + * Failure: FAIL (-1) (negative value) + * + * Programmer: + * + * Jacob Smith + * 15 August 2018 + * + * Changes: None. + *------------------------------------------------------------------------- + */ +herr_t +H5Fget_dset_no_attrs_hint(hid_t file_id, hbool_t *minimize) +{ + H5VL_object_t *vol_obj = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "i*b", file_id, minimize); + + if(NULL == minimize) + HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "out pointer 'minimize' cannot be NULL") + + vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE); + if(NULL == vol_obj) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + + if(H5VL_file_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_FILE_GET_MIN_DSET_OHDR_FLAG, minimize) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file's dataset header minimization flag") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fget_dset_no_attrs_hint */ + + +/*------------------------------------------------------------------------- + * Function: H5Fset_dset_no_attrs_hint + * + * Purpose: + * + * Set the file-level setting to create minimized dataset object headers. + * + * Return: + * + * Success: SUCCEED (0) (non-negative value) + * Failure: FAIL (-1) (negative value) + * + * Programmer: + * + * Jacob Smith + * 15 August 2018 + * + * Changes: None. + *------------------------------------------------------------------------- + */ +herr_t +H5Fset_dset_no_attrs_hint(hid_t file_id, hbool_t minimize) +{ + H5VL_object_t *vol_obj = NULL; + herr_t ret_value = SUCCEED; + + FUNC_ENTER_API(FAIL) + H5TRACE2("e", "ib", file_id, minimize); + + vol_obj = (H5VL_object_t *)H5I_object_verify(file_id, H5I_FILE); + if(NULL == vol_obj) + HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid file identifier") + + if(H5VL_file_optional(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, H5VL_NATIVE_FILE_SET_MIN_DSET_OHDR_FLAG, minimize) < 0) + HGOTO_ERROR(H5E_FILE, H5E_CANTSET, FAIL, "unable to set file's dataset header minimization flag") + +done: + FUNC_LEAVE_API(ret_value) +} /* H5Fset_dset_no_attrs_hint */ + |