mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-03-19 16:50:46 +08:00
HDFFV-10297 merge from develop
This commit is contained in:
parent
bd6de98d17
commit
f92ccce1f9
@ -122,7 +122,7 @@ if (TEST_MASK_ERROR)
|
||||
endif ()
|
||||
|
||||
# if the return value is !=0 bail out
|
||||
if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
message (STATUS "ERROR OUTPUT: ${TEST_STREAM}")
|
||||
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != 0.\n${TEST_ERROR}")
|
||||
endif ()
|
||||
@ -141,13 +141,13 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT} ${TEST_FOLDER}/${TEST_REFERENCE}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0")
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
@ -160,14 +160,14 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (${len_act} STREQUAL "0")
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (${len_ref} STREQUAL "0")
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT ${len_act} STREQUAL ${len_ref})
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -175,7 +175,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
@ -191,14 +191,14 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0")
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
@ -211,14 +211,14 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (${len_act} STREQUAL "0")
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if (${len_ref} STREQUAL "0")
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
endif ()
|
||||
endif()
|
||||
if (NOT ${len_act} STREQUAL ${len_ref})
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -239,15 +239,15 @@ if (TEST_GREP_COMPARE)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if (${TEST_RESULT} STREQUAL "0")
|
||||
if ("${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (${TEST_EXPECT} STREQUAL "1")
|
||||
if ("${TEST_EXPECT}" STREQUAL "1")
|
||||
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT ${TEST_RESULT} STREQUAL "0")
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -60,12 +60,12 @@ if (ERROR_APPEND AND EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.err)
|
||||
endif ()
|
||||
|
||||
# if the return value is !=${TEST_EXPECT} bail out
|
||||
if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}_${TEST_VFD}.out TEST_STREAM)
|
||||
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
|
||||
endif ()
|
||||
message (STATUS "Output USING ${TEST_VFD}:\n${TEST_STREAM}")
|
||||
endif ()
|
||||
endif ()
|
||||
message (FATAL_ERROR "Failed: Test program ${TEST_PROGRAM} exited != ${TEST_EXPECT}.\n${TEST_ERROR}")
|
||||
endif ()
|
||||
|
@ -57,15 +57,15 @@ file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
# TEST_REFERENCE should always be matched
|
||||
string (REGEX MATCH "${TEST_REFERENCE}" TEST_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${TEST_REFERENCE}" "${TEST_MATCH}" TEST_RESULT)
|
||||
if (${TEST_RESULT} STREQUAL "0")
|
||||
if ("${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
string (REGEX MATCH "${TEST_FILTER}" TEST_MATCH ${TEST_STREAM})
|
||||
if (${TEST_EXPECT} STREQUAL "1")
|
||||
if ("${TEST_EXPECT}" STREQUAL "1")
|
||||
# TEST_EXPECT (1) interperts TEST_FILTER as NOT to match
|
||||
string (LENGTH "${TEST_MATCH}" TEST_RESULT)
|
||||
if (NOT ${TEST_RESULT} STREQUAL "0")
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_PROGRAM} did contain ${TEST_FILTER}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -87,7 +87,7 @@ if (TEST_REGEX)
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
string (REGEX MATCH "${TEST_REGEX}" REGEX_MATCH ${TEST_STREAM})
|
||||
string (COMPARE EQUAL "${REGEX_MATCH}" "${TEST_MATCH}" REGEX_RESULT)
|
||||
if (${REGEX_RESULT} STREQUAL "0")
|
||||
if ("${REGEX_RESULT}" STREQUAL "0")
|
||||
message (STATUS "Failed: The output of ${TEST_PROGRAM} did not contain ${TEST_MATCH}")
|
||||
endif ()
|
||||
endif ()
|
||||
@ -106,7 +106,7 @@ if (TEST_APPEND)
|
||||
endif ()
|
||||
|
||||
# if the return value is !=${TEST_EXPECT} bail out
|
||||
if (NOT ${TEST_RESULT} STREQUAL ${TEST_EXPECT})
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "${TEST_EXPECT}")
|
||||
if (NOT TEST_NOERRDISPLAY)
|
||||
if (EXISTS ${TEST_FOLDER}/${TEST_OUTPUT})
|
||||
file (READ ${TEST_FOLDER}/${TEST_OUTPUT} TEST_STREAM)
|
||||
@ -193,13 +193,13 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT} test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_REFERENCE} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0")
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
@ -212,14 +212,14 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (${len_act} STREQUAL "0")
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT} is empty")
|
||||
endif ()
|
||||
if (${len_ref} STREQUAL "0")
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_REFERENCE} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT ${len_act} STREQUAL ${len_ref})
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -227,7 +227,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The output of ${TEST_OUTPUT} did not match ${TEST_REFERENCE}")
|
||||
endif ()
|
||||
|
||||
@ -243,14 +243,14 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
COMMAND ${CMAKE_COMMAND} -E compare_files ${TEST_FOLDER}/${TEST_OUTPUT}.err ${TEST_FOLDER}/${TEST_ERRREF}
|
||||
RESULT_VARIABLE TEST_RESULT
|
||||
)
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
set (TEST_RESULT 0)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_OUTPUT}.err test_act)
|
||||
list (LENGTH test_act len_act)
|
||||
file (STRINGS ${TEST_FOLDER}/${TEST_ERRREF} test_ref)
|
||||
list (LENGTH test_ref len_ref)
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
if (NOT ${len_act} STREQUAL "0" AND NOT ${len_ref} STREQUAL "0")
|
||||
if (NOT "${len_act}" STREQUAL "0" AND NOT "${len_ref}" STREQUAL "0")
|
||||
math (EXPR _FP_LEN "${len_ref} - 1")
|
||||
foreach (line RANGE 0 ${_FP_LEN})
|
||||
list (GET test_act ${line} str_act)
|
||||
@ -263,14 +263,14 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
endif ()
|
||||
endforeach ()
|
||||
else ()
|
||||
if (${len_act} STREQUAL "0")
|
||||
if ("${len_act}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_OUTPUT}.err is empty")
|
||||
endif ()
|
||||
if (${len_ref} STREQUAL "0")
|
||||
if ("${len_ref}" STREQUAL "0")
|
||||
message (STATUS "COMPARE Failed: ${TEST_FOLDER}/${TEST_ERRREF} is empty")
|
||||
endif ()
|
||||
endif ()
|
||||
if (NOT ${len_act} STREQUAL ${len_ref})
|
||||
if (NOT "${len_act}" STREQUAL "${len_ref}")
|
||||
set (TEST_RESULT 1)
|
||||
endif ()
|
||||
endif ()
|
||||
@ -278,7 +278,7 @@ if (NOT TEST_SKIP_COMPARE)
|
||||
message (STATUS "COMPARE Result: ${TEST_RESULT}")
|
||||
|
||||
# again, if return value is !=0 scream and shout
|
||||
if (NOT ${TEST_RESULT} STREQUAL 0)
|
||||
if (NOT "${TEST_RESULT}" STREQUAL "0")
|
||||
message (FATAL_ERROR "Failed: The error output of ${TEST_OUTPUT}.err did not match ${TEST_ERRREF}")
|
||||
endif ()
|
||||
endif ()
|
||||
|
@ -101,7 +101,7 @@ if (BUILD_TESTING)
|
||||
endif (H5_HAVE_FILTER_SZIP)
|
||||
|
||||
foreach (example ${HDF_JAVA_EXAMPLES})
|
||||
if (${example} STREQUAL "H5Ex_D_External")
|
||||
if ("${example}" STREQUAL "H5Ex_D_External")
|
||||
add_test (
|
||||
NAME JAVA_datasets-${example}-clear-objects
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
@ -129,7 +129,7 @@ if (BUILD_TESTING)
|
||||
)
|
||||
set_tests_properties (JAVA_datasets-${example}-copy-objects PROPERTIES DEPENDS JAVA_datasets-${example}-clear-objects)
|
||||
set (last_test "JAVA_datasets-${example}-copy-objects")
|
||||
if (${example} STREQUAL "H5Ex_D_Szip")
|
||||
if ("${example}" STREQUAL "H5Ex_D_Szip")
|
||||
if (USE_FILTER_SZIP)
|
||||
ADD_H5_TEST (${example} 0)
|
||||
endif ()
|
||||
|
@ -90,8 +90,8 @@ ENDMACRO ()
|
||||
|
||||
if (BUILD_TESTING)
|
||||
foreach (example ${HDF_JAVA_EXAMPLES})
|
||||
if (NOT ${example} STREQUAL "H5Ex_G_Iterate" AND NOT ${example} STREQUAL "H5Ex_G_Visit")
|
||||
if (${example} STREQUAL "H5Ex_G_Compact")
|
||||
if (NOT "${example}" STREQUAL "H5Ex_G_Iterate" AND NOT "${example}" STREQUAL "H5Ex_G_Visit")
|
||||
if ("${example}" STREQUAL "H5Ex_G_Compact")
|
||||
add_test (
|
||||
NAME JAVA_groups-${example}-clear-h5s
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
|
@ -206,6 +206,17 @@ Bug Fixes since HDF5-1.10.0-patch1 release
|
||||
|
||||
Library
|
||||
-------
|
||||
- H5Zfilter_avail in H5Z.c
|
||||
|
||||
The public function checked for plugins, while the private
|
||||
function did not.
|
||||
|
||||
Modified H5Zfilter_avail and private function, H5Z_filter_avail.
|
||||
Moved check for plugin from public to private function. Updated
|
||||
H5P__set_filter due to change in H5Z_filter_avail. Updated tests.
|
||||
|
||||
(ADB - 2017/10/10, HDFFV-10297)
|
||||
|
||||
- Fix H5HL_offset_into()
|
||||
|
||||
(1) Fix H5HL_offset_into() to return error when offset exceeds heap data
|
||||
@ -299,6 +310,18 @@ Bug Fixes since HDF5-1.10.0-patch1 release
|
||||
|
||||
Tools
|
||||
-----
|
||||
- h5repack
|
||||
|
||||
h5repack failed to copy a dataset with existing filter.
|
||||
|
||||
Reworked code for h5repack and h5diff code in tools library. Added
|
||||
improved error handling, cleanup of resources and checks of calls.
|
||||
Modified H5Zfilter_avail and private function, H5Z_filter_avail.
|
||||
Moved check for plugin from public to private function. Updated
|
||||
H5P__set_filter due to change in H5Z_filter_avail. Updated tests.
|
||||
|
||||
(ADB - 2017/10/10, HDFFV-10297)
|
||||
|
||||
- h5repack
|
||||
|
||||
h5repack always set the User Defined filter flag to H5Z_FLAG_MANDATORY.
|
||||
|
@ -11,9 +11,9 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Programmer: Raymond Lu <songyulu@hdfgroup.org>
|
||||
* 13 February 2013
|
||||
* Purpose: Header file for writing external HDF5 plugins.
|
||||
*/
|
||||
|
||||
#ifndef _H5PLextern_H
|
||||
#define _H5PLextern_H
|
||||
|
||||
|
@ -11,13 +11,11 @@
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/*
|
||||
* Programmer: Quincey Koziol <koziol@hdfgroup.org>
|
||||
* Saturday, September 12, 2015
|
||||
*
|
||||
* Purpose: This file contains declarations which define macros for the
|
||||
* H5PL package. Including this header means that the source file
|
||||
* is part of the H5PL package.
|
||||
* Purpose: This file contains declarations which define macros for the
|
||||
* H5PL package. Including this header means that the source file
|
||||
* is part of the H5PL package.
|
||||
*/
|
||||
|
||||
#ifndef _H5PLmodule_H
|
||||
#define _H5PLmodule_H
|
||||
|
||||
|
@ -10,8 +10,8 @@
|
||||
* help@hdfgroup.org. *
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
|
||||
/* Programmer: Raymond Lu <songyulu@hdfgroup.org>
|
||||
* 13 February 2013
|
||||
/*
|
||||
* This file contains private information about the H5PL module
|
||||
*/
|
||||
|
||||
#ifndef _H5PLprivate_H
|
||||
|
412
src/H5Pocpl.c
412
src/H5Pocpl.c
@ -13,11 +13,11 @@
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* Created: H5Pocpl.c
|
||||
* Nov 28 2006
|
||||
* Quincey Koziol <koziol@hdfgroup.org>
|
||||
* Created: H5Pocpl.c
|
||||
* Nov 28 2006
|
||||
* Quincey Koziol <koziol@hdfgroup.org>
|
||||
*
|
||||
* Purpose: Object creation property list class routines
|
||||
* Purpose: Object creation property list class routines
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -26,21 +26,21 @@
|
||||
/* Module Setup */
|
||||
/****************/
|
||||
|
||||
#define H5O_FRIEND /*suppress error about including H5Opkg */
|
||||
#define H5O_FRIEND /*suppress error about including H5Opkg */
|
||||
#include "H5Pmodule.h" /* This source code file is part of the H5P module */
|
||||
|
||||
|
||||
/***********/
|
||||
/* Headers */
|
||||
/***********/
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5MMprivate.h" /* Memory management */
|
||||
#include "H5Opkg.h" /* Object headers */
|
||||
#include "H5Ppkg.h" /* Property lists */
|
||||
#include "H5PLprivate.h" /* Dynamic plugin */
|
||||
#include "H5Zprivate.h" /* Filter pipeline */
|
||||
#include "H5private.h" /* Generic Functions */
|
||||
#include "H5Eprivate.h" /* Error handling */
|
||||
#include "H5Iprivate.h" /* IDs */
|
||||
#include "H5MMprivate.h" /* Memory management */
|
||||
#include "H5Opkg.h" /* Object headers */
|
||||
#include "H5Ppkg.h" /* Property lists */
|
||||
#include "H5PLprivate.h" /* Dynamic plugin */
|
||||
#include "H5Zprivate.h" /* Filter pipeline */
|
||||
|
||||
|
||||
/****************/
|
||||
@ -100,7 +100,7 @@ static int H5P__ocrt_pipeline_cmp(const void *value1, const void *value2, size_t
|
||||
static herr_t H5P__ocrt_pipeline_close(const char *name, size_t size, void *value);
|
||||
|
||||
/* Local routines */
|
||||
static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter,
|
||||
static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter,
|
||||
unsigned int flags, size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/]);
|
||||
|
||||
/*********************/
|
||||
@ -109,21 +109,21 @@ static herr_t H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter,
|
||||
|
||||
/* Object creation property list class library initialization object */
|
||||
const H5P_libclass_t H5P_CLS_OCRT[1] = {{
|
||||
"object create", /* Class name for debugging */
|
||||
H5P_TYPE_OBJECT_CREATE, /* Class type */
|
||||
"object create", /* Class name for debugging */
|
||||
H5P_TYPE_OBJECT_CREATE, /* Class type */
|
||||
|
||||
&H5P_CLS_ROOT_g, /* Parent class */
|
||||
&H5P_CLS_OBJECT_CREATE_g, /* Pointer to class */
|
||||
&H5P_CLS_OBJECT_CREATE_ID_g, /* Pointer to class ID */
|
||||
NULL, /* Pointer to default property list ID */
|
||||
H5P__ocrt_reg_prop, /* Default property registration routine */
|
||||
&H5P_CLS_ROOT_g, /* Parent class */
|
||||
&H5P_CLS_OBJECT_CREATE_g, /* Pointer to class */
|
||||
&H5P_CLS_OBJECT_CREATE_ID_g, /* Pointer to class ID */
|
||||
NULL, /* Pointer to default property list ID */
|
||||
H5P__ocrt_reg_prop, /* Default property registration routine */
|
||||
|
||||
NULL, /* Class creation callback */
|
||||
NULL, /* Class creation callback info */
|
||||
NULL, /* Class copy callback */
|
||||
NULL, /* Class copy callback info */
|
||||
NULL, /* Class close callback */
|
||||
NULL /* Class close callback info */
|
||||
NULL, /* Class creation callback */
|
||||
NULL, /* Class creation callback info */
|
||||
NULL, /* Class copy callback */
|
||||
NULL, /* Class copy callback info */
|
||||
NULL, /* Class close callback */
|
||||
NULL /* Class close callback info */
|
||||
}};
|
||||
|
||||
|
||||
@ -165,25 +165,25 @@ H5P__ocrt_reg_prop(H5P_genclass_t *pclass)
|
||||
FUNC_ENTER_STATIC
|
||||
|
||||
/* Register max. compact attribute storage property */
|
||||
if(H5P_register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &H5O_def_attr_max_compact_g,
|
||||
if(H5P_register_real(pclass, H5O_CRT_ATTR_MAX_COMPACT_NAME, H5O_CRT_ATTR_MAX_COMPACT_SIZE, &H5O_def_attr_max_compact_g,
|
||||
NULL, NULL, NULL, H5O_CRT_ATTR_MAX_COMPACT_ENC, H5O_CRT_ATTR_MAX_COMPACT_DEC,
|
||||
NULL, NULL, NULL, NULL) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register min. dense attribute storage property */
|
||||
if(H5P_register_real(pclass, H5O_CRT_ATTR_MIN_DENSE_NAME, H5O_CRT_ATTR_MIN_DENSE_SIZE, &H5O_def_attr_min_dense_g,
|
||||
if(H5P_register_real(pclass, H5O_CRT_ATTR_MIN_DENSE_NAME, H5O_CRT_ATTR_MIN_DENSE_SIZE, &H5O_def_attr_min_dense_g,
|
||||
NULL, NULL, NULL, H5O_CRT_ATTR_MIN_DENSE_ENC, H5O_CRT_ATTR_MIN_DENSE_DEC,
|
||||
NULL, NULL, NULL, NULL) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register object header flags property */
|
||||
if(H5P_register_real(pclass, H5O_CRT_OHDR_FLAGS_NAME, H5O_CRT_OHDR_FLAGS_SIZE, &H5O_def_ohdr_flags_g,
|
||||
if(H5P_register_real(pclass, H5O_CRT_OHDR_FLAGS_NAME, H5O_CRT_OHDR_FLAGS_SIZE, &H5O_def_ohdr_flags_g,
|
||||
NULL, NULL, NULL, H5O_CRT_OHDR_FLAGS_ENC, H5O_CRT_OHDR_FLAGS_DEC,
|
||||
NULL, NULL, NULL, NULL) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
|
||||
/* Register the pipeline property */
|
||||
if(H5P_register_real(pclass, H5O_CRT_PIPELINE_NAME, H5O_CRT_PIPELINE_SIZE, &H5O_def_pline_g,
|
||||
if(H5P_register_real(pclass, H5O_CRT_PIPELINE_NAME, H5O_CRT_PIPELINE_SIZE, &H5O_def_pline_g,
|
||||
NULL, H5O_CRT_PIPELINE_SET, H5O_CRT_PIPELINE_GET, H5O_CRT_PIPELINE_ENC, H5O_CRT_PIPELINE_DEC,
|
||||
H5O_CRT_PIPELINE_DEL, H5O_CRT_PIPELINE_COPY, H5O_CRT_PIPELINE_CMP, H5O_CRT_PIPELINE_CLOSE) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTINSERT, FAIL, "can't insert property into class")
|
||||
@ -194,9 +194,9 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pset_attr_phase_change
|
||||
* Function: H5Pset_attr_phase_change
|
||||
*
|
||||
* Purpose: Sets the cutoff values for indexes storing attributes
|
||||
* Purpose: Sets the cutoff values for indexes storing attributes
|
||||
* in object headers for this file. If more than max_compact
|
||||
* attributes are in an object header, the attributes will be
|
||||
* moved to a heap and indexed with a B-tree.
|
||||
@ -208,10 +208,10 @@ done:
|
||||
* never be stored in the object header but will be always be
|
||||
* stored in a heap.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, November 28, 2006
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, November 28, 2006
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -248,14 +248,14 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_attr_phase_change
|
||||
* Function: H5Pget_attr_phase_change
|
||||
*
|
||||
* Purpose: Gets the phase change values for attribute storage
|
||||
* Purpose: Gets the phase change values for attribute storage
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, November 28, 2006
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, November 28, 2006
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -486,37 +486,37 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P_modify_filter
|
||||
* Function: H5P_modify_filter
|
||||
*
|
||||
* Purpose: Modifies the specified FILTER in the
|
||||
* transient or permanent output filter pipeline
|
||||
* depending on whether PLIST is a dataset creation or dataset
|
||||
* transfer property list. The FLAGS argument specifies certain
|
||||
* general properties of the filter and is documented below.
|
||||
* The CD_VALUES is an array of CD_NELMTS integers which are
|
||||
* auxiliary data for the filter. The integer vlues will be
|
||||
* stored in the dataset object header as part of the filter
|
||||
* information.
|
||||
* Purpose: Modifies the specified FILTER in the
|
||||
* transient or permanent output filter pipeline
|
||||
* depending on whether PLIST is a dataset creation or dataset
|
||||
* transfer property list. The FLAGS argument specifies certain
|
||||
* general properties of the filter and is documented below.
|
||||
* The CD_VALUES is an array of CD_NELMTS integers which are
|
||||
* auxiliary data for the filter. The integer vlues will be
|
||||
* stored in the dataset object header as part of the filter
|
||||
* information.
|
||||
*
|
||||
* The FLAGS argument is a bit vector of the following fields:
|
||||
* The FLAGS argument is a bit vector of the following fields:
|
||||
*
|
||||
* H5Z_FLAG_OPTIONAL(0x0001)
|
||||
* If this bit is set then the filter is optional. If the
|
||||
* filter fails during an H5Dwrite() operation then the filter
|
||||
* is just excluded from the pipeline for the chunk for which it
|
||||
* failed; the filter will not participate in the pipeline
|
||||
* during an H5Dread() of the chunk. If this bit is clear and
|
||||
* the filter fails then the entire I/O operation fails.
|
||||
* H5Z_FLAG_OPTIONAL(0x0001)
|
||||
* If this bit is set then the filter is optional. If the
|
||||
* filter fails during an H5Dwrite() operation then the filter
|
||||
* is just excluded from the pipeline for the chunk for which it
|
||||
* failed; the filter will not participate in the pipeline
|
||||
* during an H5Dread() of the chunk. If this bit is clear and
|
||||
* the filter fails then the entire I/O operation fails.
|
||||
* If this bit is set but encoding is disabled for a filter,
|
||||
* attempting to write will generate an error.
|
||||
*
|
||||
* Note: This function currently supports only the permanent filter
|
||||
* pipeline. That is, PLIST_ID must be a dataset creation
|
||||
* property list.
|
||||
* Note: This function currently supports only the permanent filter
|
||||
* pipeline. That is, PLIST_ID must be a dataset creation
|
||||
* property list.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Programmer: Quincey Koziol
|
||||
* Wednesday, October 17, 2007
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@ -623,33 +623,33 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pset_filter
|
||||
* Function: H5Pset_filter
|
||||
*
|
||||
* Purpose: Adds the specified FILTER and corresponding properties to the
|
||||
* end of the data or link output filter pipeline
|
||||
* depending on whether PLIST is a dataset creation or group
|
||||
* creation property list. The FLAGS argument specifies certain
|
||||
* general properties of the filter and is documented below.
|
||||
* The CD_VALUES is an array of CD_NELMTS integers which are
|
||||
* auxiliary data for the filter. The integer vlues will be
|
||||
* stored in the dataset object header as part of the filter
|
||||
* information.
|
||||
* Purpose: Adds the specified FILTER and corresponding properties to the
|
||||
* end of the data or link output filter pipeline
|
||||
* depending on whether PLIST is a dataset creation or group
|
||||
* creation property list. The FLAGS argument specifies certain
|
||||
* general properties of the filter and is documented below.
|
||||
* The CD_VALUES is an array of CD_NELMTS integers which are
|
||||
* auxiliary data for the filter. The integer vlues will be
|
||||
* stored in the dataset object header as part of the filter
|
||||
* information.
|
||||
*
|
||||
* The FLAGS argument is a bit vector of the following fields:
|
||||
* The FLAGS argument is a bit vector of the following fields:
|
||||
*
|
||||
* H5Z_FLAG_OPTIONAL(0x0001)
|
||||
* If this bit is set then the filter is optional. If the
|
||||
* filter fails during an H5Dwrite() operation then the filter
|
||||
* is just excluded from the pipeline for the chunk for which it
|
||||
* failed; the filter will not participate in the pipeline
|
||||
* during an H5Dread() of the chunk. If this bit is clear and
|
||||
* the filter fails then the entire I/O operation fails.
|
||||
* H5Z_FLAG_OPTIONAL(0x0001)
|
||||
* If this bit is set then the filter is optional. If the
|
||||
* filter fails during an H5Dwrite() operation then the filter
|
||||
* is just excluded from the pipeline for the chunk for which it
|
||||
* failed; the filter will not participate in the pipeline
|
||||
* during an H5Dread() of the chunk. If this bit is clear and
|
||||
* the filter fails then the entire I/O operation fails.
|
||||
* If this bit is set but encoding is disabled for a filter,
|
||||
* attempting to write will generate an error.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, April 15, 1998
|
||||
*
|
||||
* Modifications:
|
||||
@ -668,7 +668,7 @@ done:
|
||||
*/
|
||||
herr_t
|
||||
H5Pset_filter(hid_t plist_id, H5Z_filter_t filter, unsigned int flags,
|
||||
size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/])
|
||||
size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/])
|
||||
{
|
||||
H5P_genplist_t *plist; /* Property list */
|
||||
herr_t ret_value=SUCCEED; /* return value */
|
||||
@ -698,43 +698,43 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P__set_filter
|
||||
* Function: H5P__set_filter
|
||||
*
|
||||
* Purpose: Adds the specified FILTER and corresponding properties to the
|
||||
* end of the data or link output filter pipeline
|
||||
* depending on whether PLIST is a dataset creation or group
|
||||
* creation property list. The FLAGS argument specifies certain
|
||||
* general properties of the filter and is documented below.
|
||||
* The CD_VALUES is an array of CD_NELMTS integers which are
|
||||
* auxiliary data for the filter. The integer vlues will be
|
||||
* stored in the dataset object header as part of the filter
|
||||
* information.
|
||||
* Purpose: Adds the specified FILTER and corresponding properties to the
|
||||
* end of the data or link output filter pipeline
|
||||
* depending on whether PLIST is a dataset creation or group
|
||||
* creation property list. The FLAGS argument specifies certain
|
||||
* general properties of the filter and is documented below.
|
||||
* The CD_VALUES is an array of CD_NELMTS integers which are
|
||||
* auxiliary data for the filter. The integer vlues will be
|
||||
* stored in the dataset object header as part of the filter
|
||||
* information.
|
||||
*
|
||||
* The FLAGS argument is a bit vector of the following fields:
|
||||
* The FLAGS argument is a bit vector of the following fields:
|
||||
*
|
||||
* H5Z_FLAG_OPTIONAL(0x0001)
|
||||
* If this bit is set then the filter is optional. If the
|
||||
* filter fails during an H5Dwrite() operation then the filter
|
||||
* is just excluded from the pipeline for the chunk for which it
|
||||
* failed; the filter will not participate in the pipeline
|
||||
* during an H5Dread() of the chunk. If this bit is clear and
|
||||
* the filter fails then the entire I/O operation fails.
|
||||
* If this bit is set but encoding is disabled for a filter,
|
||||
* attempting to write will generate an error.
|
||||
* H5Z_FLAG_OPTIONAL(0x0001)
|
||||
* If this bit is set then the filter is optional. If the
|
||||
* filter fails during an H5Dwrite() operation then the filter
|
||||
* is just excluded from the pipeline for the chunk for which it
|
||||
* failed; the filter will not participate in the pipeline
|
||||
* during an H5Dread() of the chunk. If this bit is clear and
|
||||
* the filter fails then the entire I/O operation fails.
|
||||
* If this bit is set but encoding is disabled for a filter,
|
||||
* attempting to write will generate an error.
|
||||
*
|
||||
* If the filter is not registered, this function tries to load
|
||||
* If the filter is not registered, this function tries to load
|
||||
* it dynamically during run time.
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, April 15, 1998
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags,
|
||||
size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/])
|
||||
size_t cd_nelmts, const unsigned int cd_values[/*cd_nelmts*/])
|
||||
{
|
||||
H5O_pline_t pline; /* Filter pipeline */
|
||||
htri_t filter_avail; /* Filter availability */
|
||||
@ -746,16 +746,6 @@ H5P__set_filter(H5P_genplist_t *plist, H5Z_filter_t filter, unsigned int flags,
|
||||
if((filter_avail = H5Z_filter_avail(filter)) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't check filter availability")
|
||||
|
||||
/* If filter is not available, try to dynamically load it */
|
||||
if(!filter_avail) {
|
||||
const H5Z_class2_t *filter_info;
|
||||
|
||||
if(NULL == (filter_info = (const H5Z_class2_t *)H5PL_load(H5PL_TYPE_FILTER, (int)filter)))
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_CANTLOAD, FAIL, "failed to load dynamically loaded plugin")
|
||||
if(H5Z_register(filter_info) < 0)
|
||||
HGOTO_ERROR(H5E_PLINE, H5E_CANTINIT, FAIL, "unable to register filter")
|
||||
} /* end if */
|
||||
|
||||
/* Get the pipeline property to append to */
|
||||
if(H5P_peek(plist, H5O_CRT_PIPELINE_NAME, &pline) < 0)
|
||||
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get pipeline")
|
||||
@ -774,21 +764,21 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_nfilters
|
||||
* Function: H5Pget_nfilters
|
||||
*
|
||||
* Purpose: Returns the number of filters in the data or link
|
||||
* pipeline depending on whether PLIST_ID is a dataset creation
|
||||
* or group creation property list. In each pipeline the
|
||||
* filters are numbered from zero through N-1 where N is the
|
||||
* value returned by this function. During output to the file
|
||||
* the filters of a pipeline are applied in increasing order
|
||||
* (the inverse is true for input).
|
||||
* Purpose: Returns the number of filters in the data or link
|
||||
* pipeline depending on whether PLIST_ID is a dataset creation
|
||||
* or group creation property list. In each pipeline the
|
||||
* filters are numbered from zero through N-1 where N is the
|
||||
* value returned by this function. During output to the file
|
||||
* the filters of a pipeline are applied in increasing order
|
||||
* (the inverse is true for input).
|
||||
*
|
||||
* Return: Success: Number of filters or zero if there are none.
|
||||
* Return: Success: Number of filters or zero if there are none.
|
||||
*
|
||||
* Failure: Negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Tuesday, August 4, 1998
|
||||
*
|
||||
* Modifications:
|
||||
@ -827,25 +817,25 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_filter2
|
||||
* Function: H5Pget_filter2
|
||||
*
|
||||
* Purpose: This is the query counterpart of H5Pset_filter() and returns
|
||||
* information about a particular filter number in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. FILTER_CONFIG is a bit
|
||||
* Purpose: This is the query counterpart of H5Pset_filter() and returns
|
||||
* information about a particular filter number in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. FILTER_CONFIG is a bit
|
||||
* field contaning encode/decode flags from H5Zpublic.h. The IDX
|
||||
* should be a value between zero and N-1 as described for
|
||||
* H5Pget_nfilters() and the function will return failure if the
|
||||
* filter number is out of range.
|
||||
*
|
||||
* Return: Success: Filter identification number.
|
||||
* Return: Success: Filter identification number.
|
||||
*
|
||||
* Failure: H5Z_FILTER_ERROR (Negative)
|
||||
* Failure: H5Z_FILTER_ERROR (Negative)
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, April 15, 1998
|
||||
*
|
||||
* Modifications:
|
||||
@ -859,8 +849,8 @@ done:
|
||||
*/
|
||||
H5Z_filter_t
|
||||
H5Pget_filter2(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/,
|
||||
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
|
||||
size_t namelen, char name[]/*out*/,
|
||||
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
|
||||
size_t namelen, char name[]/*out*/,
|
||||
unsigned *filter_config /*out*/)
|
||||
{
|
||||
H5P_genplist_t *plist; /* Property list */
|
||||
@ -921,23 +911,23 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P_get_filter_by_id
|
||||
* Function: H5P_get_filter_by_id
|
||||
*
|
||||
* Purpose: This is an additional query counterpart of H5Pset_filter() and
|
||||
* Purpose: This is an additional query counterpart of H5Pset_filter() and
|
||||
* returns information about a particular filter in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. FILTER_CONFIG is a bit
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. FILTER_CONFIG is a bit
|
||||
* field contaning encode/decode flags from H5Zpublic.h. The ID
|
||||
* should be the filter ID to retrieve the parameters for. If the
|
||||
* filter is not set for the property list, an error will be returned.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Programmer: Quincey Koziol
|
||||
* Wednesday, October 17, 2007
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@ -971,23 +961,23 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_filter_by_id2
|
||||
* Function: H5Pget_filter_by_id2
|
||||
*
|
||||
* Purpose: This is an additional query counterpart of H5Pset_filter() and
|
||||
* Purpose: This is an additional query counterpart of H5Pset_filter() and
|
||||
* returns information about a particular filter in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. FILTER_CONFIG is a bit
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. FILTER_CONFIG is a bit
|
||||
* field contaning encode/decode flags from H5Zpublic.h. The ID
|
||||
* should be the filter ID to retrieve the parameters for. If the
|
||||
* filter is not set for the property list, an error will be returned.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, April 5, 2003
|
||||
*
|
||||
* Modifications:
|
||||
@ -1047,16 +1037,16 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pall_filters_avail
|
||||
* Function: H5Pall_filters_avail
|
||||
*
|
||||
* Purpose: This is a query routine to verify that all the filters set
|
||||
* Purpose: This is a query routine to verify that all the filters set
|
||||
* in the dataset creation property list are available currently.
|
||||
*
|
||||
* Return: Success: TRUE if all filters available, FALSE if one or
|
||||
* Return: Success: TRUE if all filters available, FALSE if one or
|
||||
* more filters not currently available.
|
||||
* Failure: FAIL on error
|
||||
* Failure: FAIL on error
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Programmer: Quincey Koziol
|
||||
* Tuesday, April 8, 2003
|
||||
*
|
||||
* Modifications:
|
||||
@ -1096,16 +1086,16 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P_filter_in_pline
|
||||
* Function: H5P_filter_in_pline
|
||||
*
|
||||
* Purpose: Check whether the filter is in the pipeline of the object
|
||||
* creation property list.
|
||||
* Purpose: Check whether the filter is in the pipeline of the object
|
||||
* creation property list.
|
||||
*
|
||||
* Return: TRUE: found
|
||||
* FALSE: not found
|
||||
* FAIL: error
|
||||
* Return: TRUE: found
|
||||
* FALSE: not found
|
||||
* FAIL: error
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Programmer: Raymond Lu
|
||||
* 26 April 2013
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@ -1198,7 +1188,7 @@ done:
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, April 15, 1998
|
||||
*
|
||||
* Modifications:
|
||||
@ -1258,7 +1248,7 @@ done:
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Raymond Lu
|
||||
* Programmer: Raymond Lu
|
||||
* Dec 19, 2002
|
||||
*
|
||||
* Modifications:
|
||||
@ -1302,13 +1292,13 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5P_get_filter
|
||||
* Function: H5P_get_filter
|
||||
*
|
||||
* Purpose: Internal component of H5Pget_filter & H5Pget_filter_id
|
||||
* Purpose: Internal component of H5Pget_filter & H5Pget_filter_id
|
||||
*
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
* Return: Non-negative on success/Negative on failure
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Programmer: Quincey Koziol
|
||||
* Monday, October 23, 2006
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
@ -1330,7 +1320,7 @@ H5P_get_filter(const H5Z_filter_info_t *filter, unsigned int *flags/*out*/,
|
||||
|
||||
/* Filter parameters */
|
||||
if(cd_values) {
|
||||
size_t i; /* Local index variable */
|
||||
size_t i; /* Local index variable */
|
||||
|
||||
for(i = 0; i < filter->cd_nelmts && i < *cd_nelmts; i++)
|
||||
cd_values[i] = filter->cd_values[i];
|
||||
@ -1460,8 +1450,8 @@ done:
|
||||
* property in the dataset access property list is
|
||||
* decoded.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Mohamad Chaarawi
|
||||
* Monday, October 10, 2011
|
||||
@ -1553,15 +1543,15 @@ H5P__ocrt_pipeline_enc(const void *value, void **_pp, size_t *size)
|
||||
* property in the dataset access property list is
|
||||
* decoded.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Mohamad Chaarawi
|
||||
* Monday, October 10, 2011
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t
|
||||
static herr_t
|
||||
H5P__ocrt_pipeline_dec(const void **_pp, void *_value)
|
||||
{
|
||||
H5O_pline_t *pline = (H5O_pline_t *)_value; /* Property to set */
|
||||
@ -1637,7 +1627,7 @@ H5P__ocrt_pipeline_dec(const void **_pp, void *_value)
|
||||
filter.cd_values = (unsigned *)H5MM_xfree(filter.cd_values);
|
||||
} /* end for */
|
||||
|
||||
done:
|
||||
done:
|
||||
FUNC_LEAVE_NOAPI(ret_value)
|
||||
} /* H5P__ocrt_pipeline_dec() */
|
||||
|
||||
@ -1830,32 +1820,32 @@ done:
|
||||
#ifndef H5_NO_DEPRECATED_SYMBOLS
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_filter1
|
||||
* Function: H5Pget_filter1
|
||||
*
|
||||
* Purpose: This is the query counterpart of H5Pset_filter() and returns
|
||||
* information about a particular filter number in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. The IDX
|
||||
* Purpose: This is the query counterpart of H5Pset_filter() and returns
|
||||
* information about a particular filter number in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. The IDX
|
||||
* should be a value between zero and N-1 as described for
|
||||
* H5Pget_nfilters() and the function will return failure if the
|
||||
* filter number is out of range.
|
||||
*
|
||||
* Return: Success: Filter identification number.
|
||||
* Return: Success: Filter identification number.
|
||||
*
|
||||
* Failure: H5Z_FILTER_ERROR (Negative)
|
||||
* Failure: H5Z_FILTER_ERROR (Negative)
|
||||
*
|
||||
* Programmer: Robb Matzke
|
||||
* Programmer: Robb Matzke
|
||||
* Wednesday, April 15, 1998
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5Z_filter_t
|
||||
H5Pget_filter1(hid_t plist_id, unsigned idx, unsigned int *flags/*out*/,
|
||||
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
|
||||
size_t namelen, char name[]/*out*/)
|
||||
size_t *cd_nelmts/*in_out*/, unsigned cd_values[]/*out*/,
|
||||
size_t namelen, char name[]/*out*/)
|
||||
{
|
||||
H5O_pline_t pline; /* Filter pipeline */
|
||||
const H5Z_filter_info_t *filter; /* Pointer to filter information */
|
||||
@ -1915,22 +1905,22 @@ done:
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: H5Pget_filter_by_id1
|
||||
* Function: H5Pget_filter_by_id1
|
||||
*
|
||||
* Purpose: This is an additional query counterpart of H5Pset_filter() and
|
||||
* Purpose: This is an additional query counterpart of H5Pset_filter() and
|
||||
* returns information about a particular filter in a permanent
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. The ID
|
||||
* or transient pipeline depending on whether PLIST_ID is a
|
||||
* dataset creation or transfer property list. On input,
|
||||
* CD_NELMTS indicates the number of entries in the CD_VALUES
|
||||
* array allocated by the caller while on exit it contains the
|
||||
* number of values defined by the filter. The ID
|
||||
* should be the filter ID to retrieve the parameters for. If the
|
||||
* filter is not set for the property list, an error will be returned.
|
||||
*
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
* Return: Success: Non-negative
|
||||
* Failure: Negative
|
||||
*
|
||||
* Programmer: Quincey Koziol
|
||||
* Programmer: Quincey Koziol
|
||||
* Friday, April 5, 2003
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
|
@ -660,7 +660,7 @@ foreach (test ${H5TEST_TESTS})
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST
|
||||
)
|
||||
else ()
|
||||
if (${test} STREQUAL "big" AND CYGWIN)
|
||||
if ("${test}" STREQUAL "big" AND CYGWIN)
|
||||
add_test (NAME H5TEST-${test}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}"
|
||||
)
|
||||
@ -701,7 +701,7 @@ if (BUILD_SHARED_LIBS)
|
||||
)
|
||||
|
||||
foreach (test ${H5TEST_TESTS})
|
||||
if (${test} STREQUAL "big" AND CYGWIN)
|
||||
if ("${test}" STREQUAL "big" AND CYGWIN)
|
||||
add_test (NAME H5TEST-shared-${test}
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${test}-shared"
|
||||
)
|
||||
@ -998,8 +998,10 @@ endif ()
|
||||
##############################################################################
|
||||
if (WIN32)
|
||||
set (CMAKE_SEP "\;")
|
||||
set (BIN_REL_PATH "../../")
|
||||
else ()
|
||||
set (CMAKE_SEP ":")
|
||||
set (BIN_REL_PATH "../")
|
||||
endif ()
|
||||
|
||||
add_test (NAME H5PLUGIN-plugin COMMAND $<TARGET_FILE:plugin>)
|
||||
@ -1086,8 +1088,8 @@ if (HDF5_TEST_VFD)
|
||||
|
||||
# Windows only macro
|
||||
macro (CHECK_VFD_TEST vfdtest vfdname resultcode)
|
||||
if (${vfdtest} STREQUAL "flush1" OR ${vfdtest} STREQUAL "flush2")
|
||||
if (${vfdname} STREQUAL "multi" OR ${vfdname} STREQUAL "split")
|
||||
if ("${vfdtest}" STREQUAL "flush1" OR "${vfdtest}" STREQUAL "flush2")
|
||||
if ("${vfdname}" STREQUAL "multi" OR "${vfdname}" STREQUAL "split")
|
||||
if (NOT BUILD_SHARED_LIBS AND NOT CMAKE_BUILD_TYPE MATCHES Debug)
|
||||
add_test (NAME VFD-${vfdname}-${vfdtest}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
@ -1176,7 +1178,7 @@ if (HDF5_TEST_VFD)
|
||||
ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/${vfdname};HDF5TestExpress=${HDF_TEST_EXPRESS}"
|
||||
WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/${vfdname}
|
||||
)
|
||||
if (BUILD_SHARED_LIBS AND NOT ${vfdtest} STREQUAL "cache")
|
||||
if (BUILD_SHARED_LIBS AND NOT "${vfdtest}" STREQUAL "cache")
|
||||
add_test (NAME VFD-${vfdname}-${vfdtest}-shared
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:${vfdtest}-shared>"
|
||||
|
2737
test/dsets.c
2737
test/dsets.c
File diff suppressed because it is too large
Load Diff
@ -461,8 +461,8 @@ hsize_t diff_attr(hid_t loc1_id,
|
||||
for(j = 0; j < rank1; j++)
|
||||
nelmts1 *= dims1[j];
|
||||
|
||||
buf1 = (void *)HDmalloc((size_t)(nelmts1 * msize1));
|
||||
buf2 = (void *)HDmalloc((size_t)(nelmts1 * msize2));
|
||||
buf1 = (void *)HDcalloc((size_t)(nelmts1), msize1);
|
||||
buf2 = (void *)HDcalloc((size_t)(nelmts1), msize2);
|
||||
if(buf1 == NULL || buf2 == NULL) {
|
||||
parallel_print("cannot read into memory\n");
|
||||
goto error;
|
||||
|
@ -170,6 +170,7 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
const char *obj2_name,
|
||||
diff_opt_t *options)
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t sid1=-1;
|
||||
hid_t sid2=-1;
|
||||
hid_t f_tid1=-1;
|
||||
@ -211,30 +212,31 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
int i;
|
||||
unsigned int vl_data = 0; /*contains VL datatypes */
|
||||
|
||||
options->err_stat = 1;
|
||||
h5difftrace("diff_datasetid start\n");
|
||||
/* Get the dataspace handle */
|
||||
if((sid1 = H5Dget_space(did1)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
|
||||
|
||||
/* Get rank */
|
||||
if((rank1 = H5Sget_simple_extent_ndims(sid1)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
|
||||
|
||||
/* Get the dataspace handle */
|
||||
if((sid2 = H5Dget_space(did2)) < 0 )
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
|
||||
|
||||
/* Get rank */
|
||||
if((rank2 = H5Sget_simple_extent_ndims(sid2)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
|
||||
|
||||
/* Get dimensions */
|
||||
if(H5Sget_simple_extent_dims(sid1, dims1, maxdim1) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
|
||||
|
||||
/* Get dimensions */
|
||||
if(H5Sget_simple_extent_dims(sid2, dims2, maxdim2) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
|
||||
h5diffdebug3("rank: %ld - %ld\n", rank1, rank2);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -244,25 +246,25 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
|
||||
/* Get the data type */
|
||||
if((f_tid1 = H5Dget_type(did1)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
|
||||
|
||||
/* Get the data type */
|
||||
if((f_tid2 = H5Dget_type(did2)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_type failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* get the storage layout type
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if((dcpl1 = H5Dget_create_plist(did1)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
|
||||
if((dcpl2 = H5Dget_create_plist(did2)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_create_plist failed");
|
||||
|
||||
if((stl1 = H5Pget_layout(dcpl1)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
|
||||
if((stl2 = H5Pget_layout(dcpl2)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* check for empty datasets
|
||||
@ -303,10 +305,10 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
*/
|
||||
h5difftrace("check for memory type and sizes\n");
|
||||
if((m_tid1 = H5Tget_native_type(f_tid1, H5T_DIR_DEFAULT)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
|
||||
|
||||
if((m_tid2 = H5Tget_native_type(f_tid2, H5T_DIR_DEFAULT)) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tget_native_type failed");
|
||||
|
||||
m_size1 = H5Tget_size(m_tid1);
|
||||
m_size2 = H5Tget_size(m_tid2);
|
||||
@ -368,14 +370,14 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
if (FAIL == match_up_memsize (f_tid1, f_tid2,
|
||||
&m_tid1, &m_tid2,
|
||||
&m_size1, &m_size2))
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "match_up_memsize failed");
|
||||
h5diffdebug3("m_size: %ld - %ld\n", m_size1, m_size2);
|
||||
dadims = dims1;
|
||||
dam_size = m_size1;
|
||||
dam_tid = m_tid1;
|
||||
danelmts = nelmts1;
|
||||
need = (size_t)(nelmts1 * m_size1); /* bytes needed */
|
||||
}
|
||||
}
|
||||
else {
|
||||
h5diffdebug3("Array dims: %d - %d\n", dims1[0], dims2[0]);
|
||||
/* Compare the smallest array, but create the largest buffer */
|
||||
@ -413,10 +415,10 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
if(buf1 != NULL && buf2 != NULL) {
|
||||
h5difftrace("buf1 != NULL && buf2 != NULL\n");
|
||||
if(H5Dread(did1, m_tid1, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf1) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
h5difftrace("H5Dread did2\n");
|
||||
if(H5Dread(did2, m_tid2, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf2) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
|
||||
/* array diff */
|
||||
nfound = diff_array(buf1, buf2, danelmts, (hsize_t)0, rank1, dadims,
|
||||
@ -427,6 +429,14 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
H5Dvlen_reclaim(m_tid1, sid1, H5P_DEFAULT, buf1);
|
||||
H5Dvlen_reclaim(m_tid2, sid2, H5P_DEFAULT, buf2);
|
||||
} /* end if */
|
||||
if(buf1 != NULL) {
|
||||
HDfree(buf1);
|
||||
buf1 = NULL;
|
||||
}
|
||||
if(buf2 != NULL) {
|
||||
HDfree(buf2);
|
||||
buf2 = NULL;
|
||||
}
|
||||
} /* end if */
|
||||
else { /* possibly not enough memory, read/compare by hyperslabs */
|
||||
size_t p_type_nbytes = dam_size; /*size of memory type */
|
||||
@ -468,9 +478,9 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
* E.g., sm_space.
|
||||
*/
|
||||
if((sm_buf1 = HDmalloc((size_t)sm_nbytes)) == NULL)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
|
||||
if((sm_buf2 = HDmalloc((size_t)sm_nbytes)) == NULL)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
|
||||
|
||||
sm_nelmts = sm_nbytes / p_type_nbytes;
|
||||
sm_space = H5Screate_simple(1, &sm_nelmts, NULL);
|
||||
@ -487,19 +497,19 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
hs_nelmts *= hs_size[i];
|
||||
} /* end for */
|
||||
if(H5Sselect_hyperslab(sid1, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
|
||||
if(H5Sselect_hyperslab(sid2, H5S_SELECT_SET, hs_offset, NULL, hs_size, NULL) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
|
||||
if(H5Sselect_hyperslab(sm_space, H5S_SELECT_SET, zero, NULL, &hs_nelmts, NULL) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sselect_hyperslab failed");
|
||||
} /* end if */
|
||||
else
|
||||
hs_nelmts = 1;
|
||||
|
||||
if(H5Dread(did1, m_tid1, sm_space, sid1, H5P_DEFAULT, sm_buf1) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
if(H5Dread(did2, m_tid2, sm_space, sid2, H5P_DEFAULT, sm_buf2) < 0)
|
||||
goto error;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
|
||||
/* get array differences. in the case of hyperslab read, increment the number of differences
|
||||
found in each hyperslab and pass the position at the beginning for printing */
|
||||
@ -521,6 +531,14 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
carry = 0;
|
||||
} /* i */
|
||||
} /* elmtno */
|
||||
if(sm_buf1 != NULL) {
|
||||
HDfree(sm_buf1);
|
||||
sm_buf1 = NULL;
|
||||
}
|
||||
if(sm_buf2 != NULL) {
|
||||
HDfree(sm_buf2);
|
||||
sm_buf2 = NULL;
|
||||
}
|
||||
|
||||
H5Sclose(sm_space);
|
||||
} /* hyperslab read */
|
||||
@ -531,40 +549,11 @@ hsize_t diff_datasetid( hid_t did1,
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
h5difftrace("compare attributes?\n");
|
||||
h5difftrace("reclaim any VL memory\n");
|
||||
|
||||
/* free */
|
||||
if(buf1 != NULL) {
|
||||
HDfree(buf1);
|
||||
buf1 = NULL;
|
||||
} /* end if */
|
||||
if(buf2 != NULL) {
|
||||
HDfree(buf2);
|
||||
buf2 = NULL;
|
||||
} /* end if */
|
||||
if(sm_buf1 != NULL) {
|
||||
HDfree(sm_buf1);
|
||||
sm_buf1 = NULL;
|
||||
} /* end if */
|
||||
if(sm_buf2 != NULL) {
|
||||
HDfree(sm_buf2);
|
||||
sm_buf2 = NULL;
|
||||
} /* end if */
|
||||
done:
|
||||
|
||||
H5E_BEGIN_TRY {
|
||||
H5Sclose(sid1);
|
||||
H5Sclose(sid2);
|
||||
H5Tclose(f_tid1);
|
||||
H5Tclose(f_tid2);
|
||||
H5Tclose(m_tid1);
|
||||
H5Tclose(m_tid2);
|
||||
} H5E_END_TRY;
|
||||
h5difftrace("diff_datasetid finish\n");
|
||||
|
||||
return nfound;
|
||||
|
||||
error:
|
||||
options->err_stat=1;
|
||||
options->err_stat = ret_value;
|
||||
|
||||
/* free */
|
||||
if(buf1 != NULL) {
|
||||
@ -606,7 +595,7 @@ error:
|
||||
H5Tclose(m_tid2);
|
||||
/* enable error reporting */
|
||||
} H5E_END_TRY;
|
||||
h5difftrace("diff_datasetid errored\n");
|
||||
h5diffdebug3("diff_datasetid return:%d with nfound:%d\n", ret_value, nfound);
|
||||
|
||||
return nfound;
|
||||
}
|
||||
|
@ -20,9 +20,9 @@
|
||||
*/
|
||||
static void print_warning(const char *dname, const char *fname)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"warning: dataset <%s> cannot be read, %s filter is not available\n",
|
||||
dname, fname);
|
||||
fprintf(stderr,
|
||||
"warning: dataset <%s> cannot be read, %s filter is not available\n",
|
||||
dname, fname);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -34,100 +34,97 @@ static void print_warning(const char *dname, const char *fname)
|
||||
* 2) the internal filters might be turned off
|
||||
*
|
||||
* Return: 1, can read, 0, cannot, -1 error
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: March 1, 2004
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int h5tools_canreadf(const char* name, /* object name, serves also as boolean print */
|
||||
hid_t dcpl_id) /* dataset creation property list */
|
||||
{
|
||||
int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
int nfilters; /* number of filters */
|
||||
H5Z_filter_t filtn; /* filter identification number */
|
||||
int i; /* index */
|
||||
int udfilter_avail; /* index */
|
||||
|
||||
int nfilters; /* number of filters */
|
||||
H5Z_filter_t filtn; /* filter identification number */
|
||||
int i; /* index */
|
||||
int udfilter_avail; /* index */
|
||||
/* get information about filters */
|
||||
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed");
|
||||
|
||||
/* get information about filters */
|
||||
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
|
||||
return -1;
|
||||
/* if we do not have filters, we can read the dataset safely */
|
||||
if (!nfilters)
|
||||
HGOTO_DONE(1);
|
||||
|
||||
/* if we do not have filters, we can read the dataset safely */
|
||||
if (!nfilters)
|
||||
return 1;
|
||||
/* check availability of filters */
|
||||
for (i = 0; i < nfilters; i++) {
|
||||
if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed");
|
||||
|
||||
/* check availability of filters */
|
||||
for (i = 0; i < nfilters; i++) {
|
||||
if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, 0, 0, 0, (size_t) 0, 0, NULL)) < 0)
|
||||
return -1;
|
||||
switch (filtn) {
|
||||
/*-------------------------------------------------------------------------
|
||||
* user defined filter
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
default:
|
||||
if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0) {
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Zfilter_avail failed");
|
||||
}
|
||||
else if (!udfilter_avail) {
|
||||
if (name)
|
||||
print_warning(name, "user defined");
|
||||
ret_value = 0;
|
||||
}
|
||||
break;
|
||||
|
||||
switch (filtn) {
|
||||
/*-------------------------------------------------------------------------
|
||||
* user defined filter
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
default:
|
||||
if ((udfilter_avail = H5Zfilter_avail(filtn)) < 0)
|
||||
return -1;
|
||||
else if (udfilter_avail == 0) {
|
||||
if (name)
|
||||
print_warning(name, "user defined");
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
#ifndef H5_HAVE_FILTER_DEFLATE
|
||||
if (name)
|
||||
print_warning(name,"deflate");
|
||||
return 0;
|
||||
if (name)
|
||||
print_warning(name,"deflate");
|
||||
ret_value = 0;
|
||||
#endif
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SZIP 4 , szip compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SZIP:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SZIP 4 , szip compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SZIP:
|
||||
#ifndef H5_HAVE_FILTER_SZIP
|
||||
if (name)
|
||||
print_warning(name,"SZIP");
|
||||
return 0;
|
||||
if (name)
|
||||
print_warning(name,"SZIP");
|
||||
ret_value = 0;
|
||||
#endif
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SHUFFLE 2 , shuffle the data
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SHUFFLE:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_FLETCHER32:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_NBIT
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_NBIT:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SCALEOFFSET
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SCALEOFFSET:
|
||||
break;
|
||||
}/*switch*/
|
||||
}/*for*/
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SHUFFLE 2 , shuffle the data
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SHUFFLE:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_FLETCHER32:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_NBIT
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_NBIT:
|
||||
break;
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SCALEOFFSET
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SCALEOFFSET:
|
||||
break;
|
||||
}/*switch*/
|
||||
}/*for*/
|
||||
|
||||
return 1;
|
||||
done:
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -138,31 +135,26 @@ int h5tools_canreadf(const char* name, /* object name, serves also as boolean pr
|
||||
* except SZIP, which may be configured decoder-only.
|
||||
*
|
||||
* Return: 1, can write, 0, cannot, -1 error
|
||||
*
|
||||
* Programmer:
|
||||
*
|
||||
* Date: October 5, 2004
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5_ATTR_CONST int
|
||||
h5tools_can_encode(H5Z_filter_t filtn) {
|
||||
switch (filtn) {
|
||||
/* user defined filter */
|
||||
default:
|
||||
/* user defined filter */
|
||||
default:
|
||||
return 0;
|
||||
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
#ifndef H5_HAVE_FILTER_DEFLATE
|
||||
return 0;
|
||||
#endif
|
||||
break;
|
||||
|
||||
case H5Z_FILTER_SZIP:
|
||||
case H5Z_FILTER_SZIP:
|
||||
#ifndef H5_HAVE_FILTER_SZIP
|
||||
return 0;
|
||||
#else
|
||||
{
|
||||
{
|
||||
unsigned int filter_config_flags;
|
||||
|
||||
if (H5Zget_filter_info(filtn, &filter_config_flags) < 0)
|
||||
@ -171,36 +163,36 @@ h5tools_can_encode(H5Z_filter_t filtn) {
|
||||
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == 0) {
|
||||
/* filter present but neither encode nor decode is supported (???) */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if ((filter_config_flags
|
||||
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_DECODE_ENABLED) {
|
||||
/* decoder only: read but not write */
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if ((filter_config_flags
|
||||
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) == H5Z_FILTER_CONFIG_ENCODE_ENABLED) {
|
||||
/* encoder only: write but not read (???) */
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
else if ((filter_config_flags
|
||||
& (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED))
|
||||
== (H5Z_FILTER_CONFIG_ENCODE_ENABLED | H5Z_FILTER_CONFIG_DECODE_ENABLED)) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case H5Z_FILTER_SHUFFLE:
|
||||
case H5Z_FILTER_SHUFFLE:
|
||||
break;
|
||||
|
||||
case H5Z_FILTER_FLETCHER32:
|
||||
case H5Z_FILTER_FLETCHER32:
|
||||
break;
|
||||
|
||||
case H5Z_FILTER_NBIT:
|
||||
case H5Z_FILTER_NBIT:
|
||||
break;
|
||||
|
||||
case H5Z_FILTER_SCALEOFFSET:
|
||||
case H5Z_FILTER_SCALEOFFSET:
|
||||
break;
|
||||
}/*switch*/
|
||||
|
||||
|
@ -284,8 +284,7 @@ hid_t copy_named_datatype(hid_t type_in, hid_t fidout,
|
||||
/* Set return value */
|
||||
ret_value = dt_ret->id_out;
|
||||
|
||||
/* Increment the ref count on id_out, because the calling function will try
|
||||
* to close it */
|
||||
/* Increment the ref count on id_out, because the calling function will try to close it */
|
||||
if(H5Iinc_ref(ret_value) < 0)
|
||||
ret_value = -1;
|
||||
|
||||
@ -482,24 +481,8 @@ copy_attr(hid_t loc_in, hid_t loc_out, named_dt_t **named_dt_head_p,
|
||||
|
||||
if (options->verbose)
|
||||
printf(FORMAT_OBJ_ATTR, "attr", name);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (H5Tclose(ftype_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
|
||||
if (H5Tclose(wtype_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
|
||||
if (H5Sclose(space_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
|
||||
if (H5Aclose(attr_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed");
|
||||
} /* u */
|
||||
|
||||
return 0;
|
||||
|
||||
done:
|
||||
H5E_BEGIN_TRY {
|
||||
if (buf) {
|
||||
@ -541,8 +524,8 @@ static int check_options(pack_opt_t *options) {
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (options->verbose && have_request(options) /* only print if requested */) {
|
||||
printf("Objects to modify layout are...\n");
|
||||
if (options->all_layout == 1) {
|
||||
printf("All objects to modify layout are...\n");
|
||||
switch (options->layout_g) {
|
||||
case H5D_COMPACT:
|
||||
strcpy(slayout, "compact");
|
||||
@ -563,14 +546,17 @@ static int check_options(pack_opt_t *options) {
|
||||
strcpy(slayout, "invalid layout\n");
|
||||
HGOTO_DONE(FAIL);
|
||||
}
|
||||
printf(" Apply %s layout to all\n", slayout);
|
||||
printf(" Apply %s layout to all", slayout);
|
||||
if (H5D_CHUNKED == options->layout_g) {
|
||||
printf("with dimension [");
|
||||
printf("with dimension [ ");
|
||||
for (j = 0; j < options->chunk_g.rank; j++)
|
||||
printf("%d ", (int) options->chunk_g.chunk_lengths[j]);
|
||||
printf("]\n");
|
||||
printf("]");
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
else
|
||||
printf("No all objects to modify layout\n");
|
||||
}/* verbose */
|
||||
|
||||
for (i = 0; i < options->op_tbl->nelems; i++) {
|
||||
@ -601,10 +587,14 @@ static int check_options(pack_opt_t *options) {
|
||||
*/
|
||||
|
||||
if (options->verbose && have_request(options) /* only print if requested */) {
|
||||
printf("Objects to apply filter are...\n");
|
||||
if (options->all_filter == 1) {
|
||||
printf("All objects to apply filter are...\n");
|
||||
for (k = 0; k < options->n_filter_g; k++) {
|
||||
H5Z_filter_t filtn = options->filter_g[k].filtn;
|
||||
if (filtn < 0) {
|
||||
printf(" Unknown\n");
|
||||
continue;
|
||||
}
|
||||
switch (filtn) {
|
||||
case H5Z_FILTER_NONE:
|
||||
printf(" Uncompress all\n");
|
||||
@ -623,6 +613,8 @@ static int check_options(pack_opt_t *options) {
|
||||
} /* k */
|
||||
};
|
||||
}
|
||||
else
|
||||
printf("No all objects to apply filter\n");
|
||||
} /* verbose */
|
||||
|
||||
for (i = 0; i < options->op_tbl->nelems; i++) {
|
||||
@ -631,7 +623,12 @@ static int check_options(pack_opt_t *options) {
|
||||
|
||||
for (j = 0; j < pack.nfilters; j++) {
|
||||
if (options->verbose) {
|
||||
printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn));
|
||||
if(pack.filter[j].filtn >= 0) {
|
||||
if(pack.filter[j].filtn > H5Z_FILTER_SCALEOFFSET)
|
||||
printf(" <%s> with %s filter %d\n", name, get_sfilter(pack.filter[j].filtn), pack.filter[j].filtn);
|
||||
else
|
||||
printf(" <%s> with %s filter\n", name, get_sfilter(pack.filter[j].filtn));
|
||||
}
|
||||
}
|
||||
has_cp = 1;
|
||||
} /* j */
|
||||
@ -661,8 +658,7 @@ static int check_options(pack_opt_t *options) {
|
||||
*/
|
||||
if (options->ublock_filename != NULL && options->ublock_size == 0) {
|
||||
if (options->verbose) {
|
||||
printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n",
|
||||
options->ublock_filename);
|
||||
printf("Warning: user block size missing for file %s. Assigning a default size of 1024...\n", options->ublock_filename);
|
||||
options->ublock_size = 1024;
|
||||
}
|
||||
}
|
||||
@ -692,27 +688,29 @@ done:
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int check_objects(const char* fname, pack_opt_t *options) {
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t fid;
|
||||
hid_t did;
|
||||
hid_t sid;
|
||||
unsigned int i;
|
||||
unsigned int uf;
|
||||
trav_table_t *travt = NULL;
|
||||
|
||||
/* nothing to do */
|
||||
if (options->op_tbl->nelems == 0)
|
||||
return 0;
|
||||
HGOTO_DONE(0);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* open the file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0) {
|
||||
printf("<%s>: %s\n", fname, H5FOPENERROR);
|
||||
return -1;
|
||||
}
|
||||
* open the file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if ((fid = h5tools_fopen(fname, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, 0)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname, H5FOPENERROR);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* get the list of objects in the file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* get the list of objects in the file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* Initialize indexing options */
|
||||
h5trav_set_index(sort_by, sort_order);
|
||||
@ -721,15 +719,15 @@ static int check_objects(const char* fname, pack_opt_t *options) {
|
||||
|
||||
/* get the list of objects in the file */
|
||||
if (h5trav_gettable(fid, travt) < 0)
|
||||
goto done;
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5trav_gettable failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* compare with user supplied list
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* compare with user supplied list
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (options->verbose)
|
||||
printf("Opening file <%s>. Searching for objects to modify...\n", fname);
|
||||
printf("Opening file. Searching %d objects to modify ...\n", travt->nobjs);
|
||||
|
||||
for (i = 0; i < options->op_tbl->nelems; i++) {
|
||||
char* name = options->op_tbl->objs[i].path;
|
||||
@ -737,73 +735,70 @@ static int check_objects(const char* fname, pack_opt_t *options) {
|
||||
printf(" <%s>", name);
|
||||
|
||||
/* the input object names are present in the file and are valid */
|
||||
if (h5trav_getindext(name, travt) < 0) {
|
||||
error_msg("%s Could not find <%s> in file <%s>. Exiting...\n",
|
||||
if (h5trav_getindext(name, travt) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%s Could not find <%s> in file <%s>. Exiting...\n",
|
||||
(options->verbose ? "\n" : ""), name, fname);
|
||||
goto done;
|
||||
}
|
||||
if (options->verbose)
|
||||
printf("...Found\n");
|
||||
|
||||
/* check for extra filter conditions */
|
||||
switch (options->op_tbl->objs[i].filter->filtn) {
|
||||
/* chunk size must be smaller than pixels per block */
|
||||
case H5Z_FILTER_SZIP:
|
||||
{
|
||||
int j;
|
||||
hsize_t csize = 1;
|
||||
unsigned ppb = options->op_tbl->objs[i].filter->cd_values[0];
|
||||
hsize_t dims[H5S_MAX_RANK];
|
||||
int rank;
|
||||
hid_t did;
|
||||
hid_t sid;
|
||||
for (uf = 0; uf < options->op_tbl->objs[i].nfilters; uf++) {
|
||||
if (options->op_tbl->objs[i].filter[uf].filtn < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter");
|
||||
/* check for extra filter conditions */
|
||||
switch (options->op_tbl->objs[i].filter[uf].filtn) {
|
||||
/* chunk size must be smaller than pixels per block */
|
||||
case H5Z_FILTER_SZIP:
|
||||
{
|
||||
int j;
|
||||
hsize_t csize = 1;
|
||||
unsigned ppb = options->op_tbl->objs[i].filter[uf].cd_values[0];
|
||||
hsize_t dims[H5S_MAX_RANK];
|
||||
int rank;
|
||||
|
||||
if (options->op_tbl->objs[i].chunk.rank > 0) {
|
||||
rank = options->op_tbl->objs[i].chunk.rank;
|
||||
for (j = 0; j < rank; j++)
|
||||
csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j];
|
||||
}
|
||||
else {
|
||||
if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
|
||||
goto done;
|
||||
if ((sid = H5Dget_space(did)) < 0)
|
||||
goto done;
|
||||
if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
|
||||
goto done;
|
||||
HDmemset(dims, 0, sizeof dims);
|
||||
if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0)
|
||||
goto done;
|
||||
for (j = 0; j < rank; j++)
|
||||
csize *= dims[j];
|
||||
if (H5Sclose(sid) < 0)
|
||||
goto done;
|
||||
if (H5Dclose(did) < 0)
|
||||
goto done;
|
||||
}
|
||||
if (options->op_tbl->objs[i].chunk.rank > 0) {
|
||||
rank = options->op_tbl->objs[i].chunk.rank;
|
||||
for (j = 0; j < rank; j++)
|
||||
csize *= options->op_tbl->objs[i].chunk.chunk_lengths[j];
|
||||
}
|
||||
else {
|
||||
if ((did = H5Dopen2(fid, name, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
|
||||
if ((sid = H5Dget_space(did)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dget_space failed");
|
||||
if ((rank = H5Sget_simple_extent_ndims(sid)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_ndims failed");
|
||||
HDmemset(dims, 0, sizeof dims);
|
||||
if (H5Sget_simple_extent_dims(sid, dims, NULL) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sget_simple_extent_dims failed");
|
||||
for (j = 0; j < rank; j++)
|
||||
csize *= dims[j];
|
||||
if (H5Sclose(sid) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Sclose failed");
|
||||
if (H5Dclose(did) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
|
||||
}
|
||||
|
||||
if (csize < ppb) {
|
||||
printf(" <warning: SZIP settins, chunk size is smaller than pixels per block>\n");
|
||||
goto done;
|
||||
if (csize < ppb) {
|
||||
printf(" <warning: SZIP settings, chunk size is smaller than pixels per block>\n");
|
||||
HGOTO_DONE(0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} /* i */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
H5Fclose(fid);
|
||||
trav_table_free(travt);
|
||||
return 0;
|
||||
} /* for uf */
|
||||
} /* for i */
|
||||
|
||||
done:
|
||||
H5Fclose(fid);
|
||||
trav_table_free(travt);
|
||||
return -1;
|
||||
H5E_BEGIN_TRY {
|
||||
H5Fclose(fid);
|
||||
H5Sclose(sid);
|
||||
H5Dclose(did);
|
||||
} H5E_END_TRY;
|
||||
if (travt)
|
||||
trav_table_free(travt);
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -833,7 +828,9 @@ static int have_request(pack_opt_t *options) {
|
||||
*/
|
||||
|
||||
static const char* get_sfilter(H5Z_filter_t filtn) {
|
||||
if (filtn == H5Z_FILTER_NONE)
|
||||
if (filtn < 0)
|
||||
return NULL;
|
||||
else if (filtn == H5Z_FILTER_NONE)
|
||||
return "NONE";
|
||||
else if (filtn == H5Z_FILTER_DEFLATE)
|
||||
return "GZIP";
|
||||
|
@ -29,7 +29,7 @@
|
||||
#define MAX_COMPACT_DSIZE 64512 /* max data size for compact layout. -1k for header size */
|
||||
|
||||
/* File space default information */
|
||||
#define FS_PAGESIZE_DEF 4096
|
||||
#define FS_PAGESIZE_DEF 4096
|
||||
#define FS_STRATEGY_DEF H5F_FSPACE_STRATEGY_FSM_AGGR
|
||||
#define FS_PERSIST_DEF FALSE
|
||||
#define FS_THRESHOLD_DEF 1
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
/* a list of names */
|
||||
typedef struct {
|
||||
char obj[MAX_NC_NAME];
|
||||
char obj[MAX_NC_NAME];
|
||||
} obj_list_t;
|
||||
|
||||
/*
|
||||
@ -60,16 +60,16 @@ typedef struct {
|
||||
#define CD_VALUES 20
|
||||
|
||||
typedef struct {
|
||||
H5Z_filter_t filtn; /* filter identification number */
|
||||
unsigned filt_flag; /* filter definition flag */
|
||||
unsigned cd_values[CD_VALUES]; /* filter client data values */
|
||||
size_t cd_nelmts; /* filter client number of values */
|
||||
H5Z_filter_t filtn; /* filter identification number */
|
||||
unsigned filt_flag; /* filter definition flag */
|
||||
unsigned cd_values[CD_VALUES]; /* filter client data values */
|
||||
size_t cd_nelmts; /* filter client number of values */
|
||||
} filter_info_t;
|
||||
|
||||
/* chunk lengths along each dimension and rank */
|
||||
typedef struct {
|
||||
hsize_t chunk_lengths[MAX_VAR_DIMS];
|
||||
int rank;
|
||||
hsize_t chunk_lengths[MAX_VAR_DIMS];
|
||||
int rank;
|
||||
} chunk_info_t;
|
||||
|
||||
/* we currently define a maximum value for the filters array,
|
||||
@ -78,19 +78,19 @@ typedef struct {
|
||||
|
||||
/* information for one object, contains PATH, CHUNK info and FILTER info */
|
||||
typedef struct {
|
||||
char path[MAX_NC_NAME]; /* name of object */
|
||||
filter_info_t filter[H5_REPACK_MAX_NFILTERS]; /* filter array */
|
||||
int nfilters; /* current number of filters */
|
||||
H5D_layout_t layout; /* layout information */
|
||||
chunk_info_t chunk; /* chunk information */
|
||||
hid_t refobj_id; /* object ID, references */
|
||||
char path[MAX_NC_NAME]; /* name of object */
|
||||
filter_info_t filter[H5_REPACK_MAX_NFILTERS]; /* filter array */
|
||||
int nfilters; /* current number of filters */
|
||||
H5D_layout_t layout; /* layout information */
|
||||
chunk_info_t chunk; /* chunk information */
|
||||
hid_t refobj_id; /* object ID, references */
|
||||
} pack_info_t;
|
||||
|
||||
/* store a table of all objects */
|
||||
typedef struct {
|
||||
unsigned int size;
|
||||
unsigned int nelems;
|
||||
pack_info_t *objs;
|
||||
unsigned int size;
|
||||
unsigned int nelems;
|
||||
pack_info_t *objs;
|
||||
} pack_opttbl_t;
|
||||
|
||||
|
||||
@ -101,30 +101,30 @@ 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 */
|
||||
hbool_t 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_fspace_strategy_t fs_strategy; /* File space handling strategy */
|
||||
int fs_persist; /* Free space section threshold */
|
||||
long fs_threshold; /* Free space section threshold */
|
||||
long long fs_pagesize; /* File space page size */
|
||||
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 */
|
||||
hbool_t 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_fspace_strategy_t fs_strategy; /* File space handling strategy */
|
||||
int fs_persist; /* Free space section threshold */
|
||||
long fs_threshold; /* Free space section threshold */
|
||||
long long fs_pagesize; /* File space page size */
|
||||
} pack_opt_t;
|
||||
|
||||
|
||||
@ -214,18 +214,18 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
* options table
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
int options_table_init( pack_opttbl_t **tbl );
|
||||
int options_table_free( pack_opttbl_t *table );
|
||||
int options_add_layout( obj_list_t *obj_list,
|
||||
unsigned n_objs,
|
||||
pack_info_t *pack,
|
||||
pack_opttbl_t *table );
|
||||
int options_add_filter ( obj_list_t *obj_list,
|
||||
unsigned n_objs,
|
||||
filter_info_t filt,
|
||||
pack_opttbl_t *table );
|
||||
pack_info_t* options_get_object( const char *path,
|
||||
pack_opttbl_t *table);
|
||||
int options_table_init(pack_opttbl_t **tbl);
|
||||
int options_table_free(pack_opttbl_t *table);
|
||||
int options_add_layout(obj_list_t *obj_list,
|
||||
unsigned n_objs,
|
||||
pack_info_t *pack,
|
||||
pack_opttbl_t *table);
|
||||
int options_add_filter(obj_list_t *obj_list,
|
||||
unsigned n_objs,
|
||||
filter_info_t filt,
|
||||
pack_opttbl_t *table);
|
||||
pack_info_t* options_get_object(const char *path,
|
||||
pack_opttbl_t *table);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* parse functions
|
||||
|
@ -109,9 +109,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
* open input file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0) {
|
||||
if ((fidin = h5tools_fopen(fnamein, H5F_ACC_RDONLY, H5P_DEFAULT, NULL, NULL, (size_t) 0)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fnamein, H5FOPENERROR);
|
||||
}
|
||||
|
||||
/* get user block size and file space strategy/persist/threshold */
|
||||
{
|
||||
@ -119,23 +118,20 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
hid_t grp_in = -1; /* group ID */
|
||||
hid_t gcpl_in = -1; /* group creation property list */
|
||||
|
||||
if ((fcpl_in = H5Fget_create_plist(fidin)) < 0) {
|
||||
if ((fcpl_in = H5Fget_create_plist(fidin)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
|
||||
}
|
||||
|
||||
if (H5Pget_userblock(fcpl_in, &ub_size) < 0) {
|
||||
if (H5Pget_userblock(fcpl_in, &ub_size) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_userblock failed to retrieve userblock size");
|
||||
}
|
||||
|
||||
/* If the -S option is not set, get "strategy" from the input file */
|
||||
if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) {
|
||||
if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy");
|
||||
}
|
||||
|
||||
/* If the -G option is not set, get "pagesize" from the input file */
|
||||
if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) {
|
||||
if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space threshold");
|
||||
}
|
||||
|
||||
/* open root group */
|
||||
if ((grp_in = H5Gopen2(fidin, "/", H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
|
||||
@ -148,23 +144,19 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
if (H5Pget_link_creation_order(gcpl_in, &crt_order_flags) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_link_creation_order failed");
|
||||
|
||||
if (H5Pclose(fcpl_in) < 0) {
|
||||
if (H5Pclose(fcpl_in) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed to close property list");
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if we need to create a non-default file creation property list */
|
||||
if (options->latest || ub_size > 0) {
|
||||
/* Create file creation property list */
|
||||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
|
||||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list");
|
||||
}
|
||||
|
||||
if (ub_size > 0) {
|
||||
if (H5Pset_userblock(fcpl, ub_size) < 0) {
|
||||
if (ub_size > 0)
|
||||
if (H5Pset_userblock(fcpl, ub_size) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set non-default userblock size");
|
||||
}
|
||||
}
|
||||
|
||||
if (options->latest) {
|
||||
unsigned i = 0, nindex = 0, mesg_type_flags[5], min_mesg_sizes[5];
|
||||
@ -172,9 +164,8 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
/* Adjust group creation parameters for root group */
|
||||
/* (So that it is created in "dense storage" form) */
|
||||
if (H5Pset_link_phase_change(fcpl, (unsigned) options->grp_compact,
|
||||
(unsigned) options->grp_indexed) < 0) {
|
||||
(unsigned) options->grp_indexed) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_phase_change failed to adjust group creation parameters for root group");
|
||||
}
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
if (options->msg_size[i] > 0) {
|
||||
@ -209,26 +200,21 @@ int copy_objects(const char* fnamein, const char* fnameout, pack_opt_t *options)
|
||||
} /* end for */
|
||||
|
||||
if (nindex > 0) {
|
||||
if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0) {
|
||||
if (H5Pset_shared_mesg_nindexes(fcpl, nindex) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_nindexes failed to set the number of shared object header message indexes");
|
||||
}
|
||||
|
||||
/* msg_size[0]=dataspace, 1=datatype, 2=file value, 3=filter pipleline, 4=attribute */
|
||||
for (i = 0; i < (nindex - 1); i++) {
|
||||
if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0) {
|
||||
for (i = 0; i < (nindex - 1); i++)
|
||||
if (H5Pset_shared_mesg_index(fcpl, i, mesg_type_flags[i], min_mesg_sizes[i]) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shared_mesg_index failed to configure the specified shared object header message index");
|
||||
} /* end if */
|
||||
} /* end for */
|
||||
} /* if (nindex>0) */
|
||||
|
||||
/* Create file access property list */
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
|
||||
} /* end if */
|
||||
|
||||
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) {
|
||||
if (H5Pset_libver_bounds(fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_libver_bounds failed to set property for using latest version of the format");
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
} /* end if */
|
||||
#if defined (H5REPACK_DEBUG_USER_BLOCK)
|
||||
@ -241,17 +227,14 @@ print_user_block(fnamein, fidin);
|
||||
*/
|
||||
if (options->ublock_size > 0) {
|
||||
/* either use the FCPL already created or create a new one */
|
||||
if (fcpl == H5P_DEFAULT) {
|
||||
if (fcpl == H5P_DEFAULT)
|
||||
/* create a file creation property list */
|
||||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
|
||||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list");
|
||||
}
|
||||
}
|
||||
|
||||
/* set user block size */
|
||||
if (H5Pset_userblock(fcpl, options->ublock_size) < 0) {
|
||||
if (H5Pset_userblock(fcpl, options->ublock_size) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_userblock failed to set userblock size");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -260,16 +243,13 @@ print_user_block(fnamein, fidin);
|
||||
*/
|
||||
if (options->alignment > 0) {
|
||||
/* either use the FAPL already created or create a new one */
|
||||
if (fapl == H5P_DEFAULT) {
|
||||
if (fapl == H5P_DEFAULT)
|
||||
/* create a file access property list */
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
|
||||
}
|
||||
}
|
||||
|
||||
if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0) {
|
||||
if (H5Pset_alignment(fapl, options->threshold, options->alignment) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_alignment failed to set alignment");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -278,16 +258,13 @@ print_user_block(fnamein, fidin);
|
||||
*/
|
||||
if (options->meta_block_size > 0) {
|
||||
/* either use the FAPL already created or create a new one */
|
||||
if (fapl == H5P_DEFAULT) {
|
||||
if (fapl == H5P_DEFAULT)
|
||||
/* create a file access property list */
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) {
|
||||
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create file access property list");
|
||||
}
|
||||
}
|
||||
|
||||
if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0) {
|
||||
if (H5Pset_meta_block_size(fapl, options->meta_block_size) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_meta_block_size failed to set metadata block size");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -296,12 +273,10 @@ print_user_block(fnamein, fidin);
|
||||
*/
|
||||
|
||||
/* either use the FCPL already created or create a new one */
|
||||
if (fcpl == H5P_DEFAULT) {
|
||||
if (fcpl == H5P_DEFAULT)
|
||||
/* create a file creation property list */
|
||||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) {
|
||||
if ((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pcreate failed to create a file creation property list");
|
||||
}
|
||||
}
|
||||
|
||||
if(H5Pset_link_creation_order(fcpl, crt_order_flags ) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_link_creation_order failed");
|
||||
@ -328,9 +303,8 @@ print_user_block(fnamein, fidin);
|
||||
set_threshold = (hsize_t)options->fs_threshold;
|
||||
|
||||
/* Set file space information as specified */
|
||||
if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0) {
|
||||
if(H5Pset_file_space_strategy(fcpl, set_strategy, set_persist, set_threshold) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_file_space_strategy failed to set file space strategy");
|
||||
}
|
||||
|
||||
if(options->fs_pagesize == -1) /* A "0" file space page size is specified by user */
|
||||
set_pagesize = (hsize_t)0;
|
||||
@ -338,30 +312,26 @@ print_user_block(fnamein, fidin);
|
||||
set_pagesize = (hsize_t)options->fs_pagesize;
|
||||
|
||||
if(set_pagesize != FS_PAGESIZE_DEF) /* Set non-default file space page size as specified */
|
||||
if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0) {
|
||||
if(H5Pset_file_space_page_size(fcpl, set_pagesize) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_file_space_page_size failed to set file space page size");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* create the output file
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (options->verbose)
|
||||
printf("Making file <%s>...\n", fnameout);
|
||||
printf("Making new file ...\n");
|
||||
|
||||
if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
|
||||
if ((fidout = H5Fcreate(fnameout, H5F_ACC_TRUNC, fcpl, fapl)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fcreate could not create file <%s>:", fnameout);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* write a new user block if requested
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (options->ublock_size > 0) {
|
||||
if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0) {
|
||||
if (options->ublock_size > 0)
|
||||
if (copy_user_block(options->ublock_filename, fnameout, options->ublock_size) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting...");
|
||||
}
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* get list of objects
|
||||
@ -381,18 +351,16 @@ print_user_block(fnamein, fidin);
|
||||
* do the copy
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (do_copy_objects(fidin, fidout, travt, options) < 0) {
|
||||
if (do_copy_objects(fidin, fidout, travt, options) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_objects from <%s> could not copy data to <%s>", fnamein, fnameout);
|
||||
} /* end if */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* do the copy of referenced objects
|
||||
* and create hard links
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (do_copy_refobjs(fidin, fidout, travt, options) < 0) {
|
||||
if (do_copy_refobjs(fidin, fidout, travt, options) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "do_copy_refobjs from <%s> could not copy data to <%s>", fnamein, fnameout);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
@ -417,11 +385,9 @@ print_user_block(fnamein, fidin);
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (ub_size > 0 && options->ublock_size == 0) {
|
||||
if (copy_user_block(fnamein, fnameout, ub_size) < 0) {
|
||||
if (ub_size > 0 && options->ublock_size == 0)
|
||||
if (copy_user_block(fnamein, fnameout, ub_size) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Could not copy user block. Exiting...");
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
@ -732,13 +698,14 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
unsigned crt_order_flags; /* group creation order flag */
|
||||
unsigned i;
|
||||
unsigned u;
|
||||
unsigned uf;
|
||||
int is_ref = 0;
|
||||
htri_t is_named;
|
||||
hbool_t limit_maxdims;
|
||||
hsize_t size_dset;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* copy the suppplied object list
|
||||
* copy the supplied object list
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@ -748,12 +715,13 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
printf("-----------------------------------------\n");
|
||||
}
|
||||
|
||||
for (i = 0; i < travt->nobjs; i++) {
|
||||
/* init variables per obj */
|
||||
buf = NULL;
|
||||
limit_maxdims = FALSE;
|
||||
if (travt->objs) {
|
||||
for (i = 0; i < travt->nobjs; i++) {
|
||||
/* init variables per obj */
|
||||
buf = NULL;
|
||||
limit_maxdims = FALSE;
|
||||
|
||||
switch (travt->objs[i].type) {
|
||||
switch (travt->objs[i].type) {
|
||||
case H5TRAV_TYPE_UNKNOWN:
|
||||
break;
|
||||
|
||||
@ -833,10 +801,15 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
req_filter = 1;
|
||||
|
||||
/* check if filters were requested for individual objects */
|
||||
for (u = 0; u < options->op_tbl->nelems; u++)
|
||||
if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0)
|
||||
if (options->op_tbl->objs[u].filter->filtn > 0)
|
||||
req_filter = 1;
|
||||
if (options->op_tbl->objs) {
|
||||
for (u = 0; u < options->op_tbl->nelems; u++) {
|
||||
if (HDstrcmp(travt->objs[i].name, options->op_tbl->objs[u].path) == 0)
|
||||
for (uf = 0; uf < options->op_tbl->objs[uf].nfilters; uf++) {
|
||||
if (options->op_tbl->objs[u].filter[uf].filtn > 0)
|
||||
req_filter = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* check if layout change requested individual object */
|
||||
if (options->layout_g != H5D_LAYOUT_ERROR) {
|
||||
@ -1012,9 +985,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
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, FAIL, dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
CHECK_H5DRW_ERROR(H5Dwrite, FAIL, dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf);
|
||||
if(H5Dread(dset_in, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
if(H5Dwrite(dset_out, wtype_id, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
|
||||
/* Check if we have VL data in the dataset's
|
||||
* datatype that must be reclaimed */
|
||||
@ -1097,9 +1071,10 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
hs_select_nelmts = 1;
|
||||
} /* rank */
|
||||
|
||||
/* read/write: use the macro to check error, e.g. memory allocation error inside the library. */
|
||||
CHECK_H5DRW_ERROR(H5Dread, FAIL, dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf);
|
||||
CHECK_H5DRW_ERROR(H5Dwrite, FAIL, dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf);
|
||||
if(H5Dread(dset_in, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
if(H5Dwrite(dset_out, wtype_id, hslab_space, f_space_id, H5P_DEFAULT, hslab_buf) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
|
||||
/* reclaim any VL memory, if necessary */
|
||||
if (vl_data)
|
||||
@ -1293,19 +1268,9 @@ int do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt,
|
||||
|
||||
default:
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "Object type not found");
|
||||
} /* switch */
|
||||
|
||||
/* free */
|
||||
if (buf != NULL) {
|
||||
HDfree(buf);
|
||||
buf = NULL;
|
||||
}
|
||||
} /* i */
|
||||
|
||||
/* Finalize (link) the stack of named datatypes (if any) */
|
||||
named_datatype_free(&named_dt_head, 0);
|
||||
|
||||
return ret_value;
|
||||
} /* switch */
|
||||
} /* end for */
|
||||
} /* end if */
|
||||
|
||||
done:
|
||||
H5E_BEGIN_TRY
|
||||
@ -1322,8 +1287,7 @@ done:
|
||||
H5Tclose(wtype_id);
|
||||
H5Tclose(type_in);
|
||||
H5Tclose(type_out);
|
||||
named_datatype_free(&named_dt_head, 1);
|
||||
}H5E_END_TRY;
|
||||
} H5E_END_TRY;
|
||||
|
||||
/* free */
|
||||
if (buf != NULL)
|
||||
@ -1331,6 +1295,14 @@ done:
|
||||
if (hslab_buf != NULL)
|
||||
HDfree(hslab_buf);
|
||||
|
||||
/* Finalize (link) the stack of named datatypes (if any) */
|
||||
if (0 == ret_value && named_dt_head != NULL)
|
||||
named_datatype_free(&named_dt_head, 0);
|
||||
else
|
||||
H5E_BEGIN_TRY {
|
||||
named_datatype_free(&named_dt_head, 1);
|
||||
} H5E_END_TRY;
|
||||
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
@ -1364,8 +1336,11 @@ static void print_dataset_info(hid_t dcpl_id, char *objname, double ratio, int p
|
||||
for (i = 0; i < nfilters; i++) {
|
||||
cd_nelmts = NELMTS(cd_values);
|
||||
|
||||
filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts,
|
||||
cd_values, sizeof(f_objname), f_objname, NULL);
|
||||
if ((filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &filt_flags, &cd_nelmts,
|
||||
cd_values, sizeof(f_objname), f_objname, NULL)) < 0) {
|
||||
HDstrcat(strfilter, "ERROR ");
|
||||
continue;
|
||||
}
|
||||
|
||||
switch (filtn) {
|
||||
case H5Z_FILTER_NONE:
|
||||
@ -1551,7 +1526,7 @@ void print_user_block(const char *filename, hid_t fid)
|
||||
}
|
||||
|
||||
/* open file */
|
||||
if((fh = HDopen(filename, O_RDONLY, 0)) < 0) {
|
||||
if((fh = HDopen(filename, O_RDONLY)) < 0) {
|
||||
HGOTO_ERROR(H5E_tools_g, H5E_tools_min_id_g, "HDopen failed to open file <%s>", filename);
|
||||
}
|
||||
|
||||
|
@ -24,24 +24,72 @@
|
||||
#undef MIN
|
||||
#define MIN(a,b) (((a)<(b)) ? (a) : (b))
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: aux_copy_obj
|
||||
*
|
||||
* Purpose: copy the object filters for object copy
|
||||
*
|
||||
* Return: 0 success, -1 failure
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int aux_copy_obj(hid_t dcpl_id, /* dataset creation property list */
|
||||
const char* name, /* object name from traverse list */
|
||||
pack_info_t *objout /*OUT*/) /* info about object to filter */
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
int nfilters; /* number of filters in DCPL */
|
||||
char f_objname[256]; /* filter objname */
|
||||
H5D_layout_t layout;
|
||||
int rank; /* rank of dataset */
|
||||
hsize_t chsize[64]; /* chunk size in elements */
|
||||
unsigned int i, j;
|
||||
|
||||
/* get information about input filters */
|
||||
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed");
|
||||
/* copy filter_info_t structure */
|
||||
for (i = 0; i < nfilters; i++) {
|
||||
if ((objout->filter[i].filtn = H5Pget_filter2(dcpl_id, (unsigned) i, &objout->filter[i].filt_flag, &objout->filter[i].cd_nelmts,
|
||||
objout->filter[i].cd_values, sizeof(f_objname), f_objname, NULL)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_filter2 failed");
|
||||
}
|
||||
|
||||
objout->nfilters = nfilters;
|
||||
HDstrcpy(objout->path, name);
|
||||
|
||||
if ((layout = H5Pget_layout(dcpl_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
|
||||
objout->layout = layout;
|
||||
|
||||
if (layout == H5D_CHUNKED) {
|
||||
if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed");
|
||||
objout->chunk.rank = rank;
|
||||
for (i = 0; i < rank; i++)
|
||||
objout->chunk.chunk_lengths[i] = chsize[i];
|
||||
}
|
||||
|
||||
done:
|
||||
return ret_value;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: aux_find_obj
|
||||
*
|
||||
* Purpose: find the object name NAME (got from the traverse list)
|
||||
* in the repack options list
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int aux_find_obj(const char* name, /* object name from traverse list */
|
||||
pack_opt_t *options, /* repack options */
|
||||
pack_info_t *obj /*OUT*/) /* info about object to filter */
|
||||
pack_opt_t *options, /* repack options */
|
||||
pack_info_t *obj /*OUT*/) /* info about object to filter */
|
||||
{
|
||||
char *pdest;
|
||||
int result;
|
||||
unsigned int i;
|
||||
|
||||
for (i = 0; i < options->op_tbl->nelems; i++) {
|
||||
if (HDstrcmp(options->op_tbl->objs[i].path,name) == 0) {
|
||||
if (HDstrcmp(options->op_tbl->objs[i].path, name) == 0) {
|
||||
*obj = options->op_tbl->objs[i];
|
||||
return (int) i;
|
||||
}
|
||||
@ -66,14 +114,12 @@ static int aux_find_obj(const char* name, /* object name from traverse list */
|
||||
* in the repack options list; assign the filter information OBJ
|
||||
*
|
||||
* Return: 0 not found, 1 found
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static int aux_assign_obj(const char* name, /* object name from traverse list */
|
||||
pack_opt_t *options, /* repack options */
|
||||
pack_info_t *obj /*OUT*/) /* info about object to filter */
|
||||
pack_opt_t *options, /* repack options */
|
||||
pack_info_t *obj /*OUT*/) /* info about object to filter */
|
||||
{
|
||||
|
||||
int idx, i;
|
||||
pack_info_t tmp;
|
||||
|
||||
@ -83,7 +129,6 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */
|
||||
|
||||
/* name was on input */
|
||||
if (idx >= 0) {
|
||||
|
||||
/* applying to all objects */
|
||||
if (options->all_layout) {
|
||||
/* assign the global layout info to the OBJ info */
|
||||
@ -92,8 +137,7 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */
|
||||
case H5D_CHUNKED:
|
||||
tmp.chunk.rank = options->chunk_g.rank;
|
||||
for (i = 0; i < tmp.chunk.rank; i++)
|
||||
tmp.chunk.chunk_lengths[i] =
|
||||
options->chunk_g.chunk_lengths[i];
|
||||
tmp.chunk.chunk_lengths[i] = options->chunk_g.chunk_lengths[i];
|
||||
break;
|
||||
case H5D_LAYOUT_ERROR:
|
||||
case H5D_COMPACT:
|
||||
@ -111,8 +155,7 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */
|
||||
case H5D_CHUNKED:
|
||||
tmp.chunk.rank = options->op_tbl->objs[idx].chunk.rank;
|
||||
for (i = 0; i < tmp.chunk.rank; i++)
|
||||
tmp.chunk.chunk_lengths[i] =
|
||||
options->op_tbl->objs[idx].chunk.chunk_lengths[i];
|
||||
tmp.chunk.chunk_lengths[i] = options->op_tbl->objs[idx].chunk.chunk_lengths[i];
|
||||
break;
|
||||
case H5D_LAYOUT_ERROR:
|
||||
case H5D_COMPACT:
|
||||
@ -123,7 +166,6 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */
|
||||
default:
|
||||
break;
|
||||
}/*switch*/
|
||||
|
||||
}
|
||||
|
||||
/* applying to all objects */
|
||||
@ -183,28 +225,24 @@ static int aux_assign_obj(const char* name, /* object name from traverse list */
|
||||
* of H5Z_FILTER_NONE present in the PACK_INFO_T filter array
|
||||
*
|
||||
* Return: 0 success, -1 an error occured
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: December 19, 2003
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int apply_filters(const char* name, /* object name from traverse list */
|
||||
int rank, /* rank of dataset */
|
||||
hsize_t *dims, /* dimensions of dataset */
|
||||
size_t msize, /* size of type */
|
||||
hid_t dcpl_id, /* dataset creation property list */
|
||||
pack_opt_t *options, /* repack options */
|
||||
int *has_filter) /* (OUT) object NAME has a filter */
|
||||
int rank, /* rank of dataset */
|
||||
hsize_t *dims, /* dimensions of dataset */
|
||||
size_t msize, /* size of type */
|
||||
hid_t dcpl_id, /* dataset creation property list */
|
||||
pack_opt_t *options, /* repack options */
|
||||
int *has_filter) /* (OUT) object NAME has a filter */
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
int nfilters; /* number of filters in DCPL */
|
||||
hsize_t chsize[64]; /* chunk size in elements */
|
||||
int nfilters; /* number of filters in DCPL */
|
||||
hsize_t chsize[64]; /* chunk size in elements */
|
||||
H5D_layout_t layout;
|
||||
int i;
|
||||
int i, j;
|
||||
pack_info_t obj;
|
||||
pack_info_t filtobj;
|
||||
|
||||
*has_filter = 0;
|
||||
|
||||
@ -212,15 +250,16 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
HGOTO_DONE(0);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* initialize the assigment object
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* initialize the assigment object
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
init_packobject(&obj);
|
||||
init_packobject(&filtobj);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* find options
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* find options
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (aux_assign_obj(name, options, &obj) == 0)
|
||||
HGOTO_DONE(0);
|
||||
|
||||
@ -228,55 +267,61 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
if ((nfilters = H5Pget_nfilters(dcpl_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_nfilters failed");
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* check if we have filters in the pipeline
|
||||
* we want to replace them with the input filters
|
||||
* only remove if we are inserting new ones
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* check if we have filters in the pipeline
|
||||
* we want to replace them with the input filters
|
||||
* only remove if we are inserting new ones
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (nfilters && obj.nfilters) {
|
||||
*has_filter = 1;
|
||||
if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* check if there is an existent chunk
|
||||
* read it only if there is not a requested layout
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (obj.layout == -1) {
|
||||
if ((layout = H5Pget_layout(dcpl_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
|
||||
/*-------------------------------------------------------------------------
|
||||
* check if there is an existent chunk
|
||||
* read it only if there is not a requested layout
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (obj.layout == -1) {
|
||||
if ((layout = H5Pget_layout(dcpl_id)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_layout failed");
|
||||
|
||||
if (layout == H5D_CHUNKED) {
|
||||
if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed");
|
||||
obj.layout = H5D_CHUNKED;
|
||||
obj.chunk.rank = rank;
|
||||
for (i = 0; i < rank; i++)
|
||||
obj.chunk.chunk_lengths[i] = chsize[i];
|
||||
if (layout == H5D_CHUNKED) {
|
||||
if ((rank = H5Pget_chunk(dcpl_id, NELMTS(chsize), chsize/*out*/)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_chunk failed");
|
||||
obj.layout = H5D_CHUNKED;
|
||||
obj.chunk.rank = rank;
|
||||
for (i = 0; i < rank; i++)
|
||||
obj.chunk.chunk_lengths[i] = chsize[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(nfilters) {
|
||||
*has_filter = 1;
|
||||
if (aux_copy_obj(dcpl_id, name, &filtobj) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "aux_copy_obj failed");
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* the type of filter and additional parameter
|
||||
* type can be one of the filters
|
||||
* H5Z_FILTER_NONE 0 , uncompress if compressed
|
||||
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
|
||||
* H5Z_FILTER_SHUFFLE 2 , shuffle the data
|
||||
* H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC
|
||||
* H5Z_FILTER_SZIP 4 , szip compression
|
||||
* H5Z_FILTER_NBIT 5 , nbit compression
|
||||
* H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* the type of filter and additional parameter
|
||||
* type can be one of the filters
|
||||
* H5Z_FILTER_NONE 0 , uncompress if compressed
|
||||
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
|
||||
* H5Z_FILTER_SHUFFLE 2 , shuffle the data
|
||||
* H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC
|
||||
* H5Z_FILTER_SZIP 4 , szip compression
|
||||
* H5Z_FILTER_NBIT 5 , nbit compression
|
||||
* H5Z_FILTER_SCALEOFFSET 6 , scaleoffset compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (obj.nfilters) {
|
||||
/*-------------------------------------------------------------------------
|
||||
* filters require CHUNK layout; if we do not have one define a default
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* filters require CHUNK layout; if we do not have one define a default
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if (obj.layout == -1) {
|
||||
/* stripmine info */
|
||||
hsize_t sm_size[H5S_MAX_RANK]; /*stripmine size */
|
||||
@ -285,9 +330,9 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
obj.chunk.rank = rank;
|
||||
|
||||
/*
|
||||
* determine the strip mine size. The strip mine is
|
||||
* a hyperslab whose size is manageable.
|
||||
*/
|
||||
* determine the strip mine size. The strip mine is
|
||||
* a hyperslab whose size is manageable.
|
||||
*/
|
||||
|
||||
sm_nbytes = msize;
|
||||
for (i = rank; i > 0; --i) {
|
||||
@ -305,18 +350,21 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
}
|
||||
|
||||
for (i = 0; i < obj.nfilters; i++) {
|
||||
if (obj.filter[i].filtn < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter");
|
||||
|
||||
switch (obj.filter[i].filtn) {
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_NONE 0 , uncompress if compressed
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* H5Z_FILTER_NONE 0 , uncompress if compressed
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_NONE:
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_DEFLATE 1 , deflation like gzip
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_DEFLATE:
|
||||
{
|
||||
unsigned aggression; /* the deflate level */
|
||||
@ -330,10 +378,10 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
}
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SZIP 4 , szip compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SZIP 4 , szip compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SZIP:
|
||||
{
|
||||
unsigned options_mask;
|
||||
@ -350,10 +398,10 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
}
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SHUFFLE 2 , shuffle the data
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_SHUFFLE 2 , shuffle the data
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SHUFFLE:
|
||||
if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed");
|
||||
@ -361,31 +409,30 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_shuffle failed");
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5Z_FILTER_FLETCHER32 3 , fletcher32 checksum of EDC
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_FLETCHER32:
|
||||
if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed");
|
||||
if (H5Pset_fletcher32(dcpl_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_fletcher32 failed");
|
||||
break;
|
||||
/*----------- -------------------------------------------------------------
|
||||
* H5Z_FILTER_NBIT , NBIT compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
/*----------- -------------------------------------------------------------
|
||||
* H5Z_FILTER_NBIT , NBIT compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_NBIT:
|
||||
if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed");
|
||||
if (H5Pset_nbit(dcpl_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_nbit failed");
|
||||
break;
|
||||
/*----------- -------------------------------------------------------------
|
||||
* H5Z_FILTER_SCALEOFFSET , scale+offset compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/*----------- -------------------------------------------------------------
|
||||
* H5Z_FILTER_SCALEOFFSET , scale+offset compression
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5Z_FILTER_SCALEOFFSET:
|
||||
{
|
||||
H5Z_SO_scale_type_t scale_type;
|
||||
@ -402,12 +449,12 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
break;
|
||||
default:
|
||||
{
|
||||
if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed");
|
||||
if (H5Pset_filter(dcpl_id, obj.filter[i].filtn,
|
||||
obj.filter[i].filt_flag, obj.filter[i].cd_nelmts,
|
||||
obj.filter[i].cd_values) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_filter failed");
|
||||
if (H5Pset_chunk(dcpl_id, obj.chunk.rank, obj.chunk.chunk_lengths) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pset_chunk failed");
|
||||
}
|
||||
break;
|
||||
} /* switch */
|
||||
@ -415,10 +462,20 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
}
|
||||
/*obj.nfilters*/
|
||||
|
||||
if (filtobj.nfilters) {
|
||||
for (i = 0; i < filtobj.nfilters; i++) {
|
||||
if (filtobj.filter[i].filtn < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "invalid filter");
|
||||
|
||||
if (H5Zfilter_avail(filtobj.filter[i].filtn) <= 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "%d filter unavailable", filtobj.filter[i].filtn);
|
||||
} /* for */
|
||||
} /* nfilters */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* layout
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* layout
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
if (obj.layout >= 0) {
|
||||
/* a layout was defined */
|
||||
@ -438,7 +495,6 @@ int apply_filters(const char* name, /* object name from traverse list */
|
||||
if (H5Premove_filter(dcpl_id, H5Z_FILTER_ALL) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Premove_filter failed");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
done:
|
||||
|
@ -428,13 +428,13 @@ int parse_command_line(int argc, const char **argv, pack_opt_t* options)
|
||||
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) {
|
||||
switch ((char) opt) {
|
||||
|
||||
/* -i for backward compability */
|
||||
/* -i for backward compatibility */
|
||||
case 'i':
|
||||
infile = opt_arg;
|
||||
has_i_o = 1;
|
||||
break;
|
||||
|
||||
/* -o for backward compability */
|
||||
/* -o for backward compatibility */
|
||||
case 'o':
|
||||
outfile = opt_arg;
|
||||
has_i_o = 1;
|
||||
@ -695,8 +695,10 @@ int main(int argc, const char **argv)
|
||||
}
|
||||
|
||||
/* initialize options */
|
||||
h5repack_init(&options, 0, FALSE);
|
||||
|
||||
if (h5repack_init(&options, 0, FALSE) < 0) {
|
||||
h5tools_setstatus(EXIT_FAILURE);
|
||||
goto done;
|
||||
}
|
||||
/* Initialize default indexing options */
|
||||
sort_by = H5_INDEX_CRT_ORDER;
|
||||
|
||||
|
@ -30,6 +30,7 @@ void init_packobject(pack_info_t *obj) {
|
||||
HDstrcpy(obj->path, "\0");
|
||||
for (j = 0; j < H5_REPACK_MAX_NFILTERS; j++) {
|
||||
obj->filter[j].filtn = -1;
|
||||
obj->filter[j].cd_nelmts = CD_VALUES;
|
||||
for (k = 0; k < CD_VALUES; k++)
|
||||
obj->filter[j].cd_values[k] = 0;
|
||||
}
|
||||
@ -261,7 +262,7 @@ options_add_filter(obj_list_t *obj_list, unsigned n_objs, filter_info_t filt, pa
|
||||
|
||||
/* search if this object is already in the table; "path" is the key */
|
||||
if (table->nelems > 0) {
|
||||
/* go tru the supplied list of names */
|
||||
/* go through the supplied list of names */
|
||||
for (j = 0; j < n_objs; j++) {
|
||||
/* linear table search */
|
||||
for (i = 0; i < table->nelems; i++) {
|
||||
|
@ -58,26 +58,30 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
|
||||
/* check for the end of object list and number of objects */
|
||||
for (i = 0, n = 0; i < len; i++) {
|
||||
c = str[i];
|
||||
if (c == ':')
|
||||
if (c == ':') {
|
||||
end_obj = (int) i;
|
||||
break;
|
||||
}
|
||||
if (c == ',')
|
||||
n++;
|
||||
}
|
||||
n++;
|
||||
|
||||
/* Check for missing : */
|
||||
if (end_obj == -1) {
|
||||
/* apply to all objects */
|
||||
options->all_filter = 1;
|
||||
*is_glb = 1;
|
||||
*n_objs = 1;
|
||||
}
|
||||
else
|
||||
*n_objs = n;
|
||||
|
||||
n++;
|
||||
obj_list = (obj_list_t *) HDmalloc(n * sizeof(obj_list_t));
|
||||
if (obj_list == NULL) {
|
||||
error_msg("could not allocate object list\n");
|
||||
return NULL;
|
||||
}
|
||||
*n_objs = n;
|
||||
|
||||
/* get object list */
|
||||
if (end_obj > 0)
|
||||
@ -89,6 +93,7 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
|
||||
sobj[k] = '\0';
|
||||
else
|
||||
sobj[k + 1] = '\0';
|
||||
|
||||
HDstrcpy(obj_list[n].obj, sobj);
|
||||
HDmemset(sobj, 0, sizeof(sobj));
|
||||
n++;
|
||||
@ -142,7 +147,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
|
||||
if (l == 2) {
|
||||
smask[l] = '\0';
|
||||
i = len - 1; /* end */
|
||||
(*n_objs)--; /* we counted an extra ',' */
|
||||
if (HDstrcmp(smask,"NN") == 0)
|
||||
filt->cd_values[j++] = H5_SZIP_NN_OPTION_MASK;
|
||||
else if (HDstrcmp(smask,"EC") == 0)
|
||||
@ -193,7 +197,6 @@ obj_list_t* parse_filter(const char *str, unsigned *n_objs, filter_info_t *filt,
|
||||
if (l == 2) {
|
||||
smask[l] = '\0';
|
||||
i = len - 1; /* end */
|
||||
(*n_objs)--; /* we counted an extra ',' */
|
||||
if (HDstrcmp(smask,"IN") == 0)
|
||||
filt->cd_values[j++] = H5Z_SO_INT;
|
||||
else if (HDstrcmp(smask, "DS") == H5Z_SO_FLOAT_DSCALE)
|
||||
|
@ -30,15 +30,10 @@ static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: do_copy_refobjs
|
||||
*
|
||||
* Purpose: duplicate all referenced HDF5 objects in the file
|
||||
* and create hard links
|
||||
*
|
||||
* Return: 0, ok, -1 no
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Date: December, 10, 2003
|
||||
* Purpose: duplicate all referenced HDF5 objects in the file
|
||||
* and create hard links
|
||||
*
|
||||
* Return: 0, ok, -1 no
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@ -47,41 +42,39 @@ int do_copy_refobjs(hid_t fidin,
|
||||
trav_table_t *travt,
|
||||
pack_opt_t *options) /* repack options */
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t grp_in = (-1); /* read group ID */
|
||||
hid_t grp_out = (-1); /* write group ID */
|
||||
hid_t dset_in = (-1); /* read dataset ID */
|
||||
hid_t dset_out = (-1); /* write dataset ID */
|
||||
hid_t type_in = (-1); /* named type ID */
|
||||
hid_t dcpl_id = (-1); /* dataset creation property list ID */
|
||||
hid_t space_id = (-1); /* space ID */
|
||||
hid_t ftype_id = (-1); /* file data type ID */
|
||||
hid_t mtype_id = (-1); /* memory data type ID */
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t grp_in = -1; /* read group ID */
|
||||
hid_t grp_out = -1; /* write group ID */
|
||||
hid_t dset_in = -1; /* read dataset ID */
|
||||
hid_t dset_out = -1; /* write dataset ID */
|
||||
hid_t type_in = -1; /* named type ID */
|
||||
hid_t dcpl_id = -1; /* dataset creation property list ID */
|
||||
hid_t space_id = -1; /* space ID */
|
||||
hid_t ftype_id = -1; /* file data type ID */
|
||||
hid_t mtype_id = -1; /* memory data type ID */
|
||||
size_t msize; /* memory size of memory type */
|
||||
hsize_t nelmts; /* number of elements in dataset */
|
||||
int rank; /* rank of dataset */
|
||||
hsize_t dims[H5S_MAX_RANK]; /* dimensions of dataset */
|
||||
unsigned int i, j;
|
||||
int k;
|
||||
named_dt_t *named_dt_head=NULL; /* Pointer to the stack of named datatypes
|
||||
copied */
|
||||
named_dt_t *named_dt_head = NULL; /* Pointer to the stack of named datatypes copied */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* browse
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
for(i = 0; i < travt->nobjs; i++) {
|
||||
switch(travt->objs[i].type)
|
||||
{
|
||||
switch(travt->objs[i].type) {
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_GROUP
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* H5TRAV_TYPE_GROUP
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_GROUP:
|
||||
/*-------------------------------------------------------------------------
|
||||
* copy referenced objects in attributes
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* copy referenced objects in attributes
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if((grp_out = H5Gopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gopen2 failed");
|
||||
|
||||
@ -97,18 +90,18 @@ int do_copy_refobjs(hid_t fidin,
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* check for hard links
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* check for hard links
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(travt->objs[i].nlinks)
|
||||
for(j = 0; j < travt->objs[i].nlinks; j++)
|
||||
H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT);
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_DATASET
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* H5TRAV_TYPE_DATASET
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_DATASET:
|
||||
if((dset_in = H5Dopen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
|
||||
@ -141,16 +134,16 @@ int do_copy_refobjs(hid_t fidin,
|
||||
*/
|
||||
if(h5tools_canreadf(NULL, dcpl_id) == 1) {
|
||||
/*-------------------------------------------------------------------------
|
||||
* test for a valid output dataset
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* test for a valid output dataset
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
dset_out = FAIL;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* object references are a special case
|
||||
* we cannot just copy the buffers, but instead we recreate the reference
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* object references are a special case
|
||||
* we cannot just copy the buffers, but instead we recreate the reference
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(H5Tequal(mtype_id, H5T_STD_REF_OBJ)) {
|
||||
hid_t refobj_id;
|
||||
hobj_ref_t *refbuf = NULL; /* buffer for object references */
|
||||
@ -159,9 +152,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
unsigned u;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* read to memory
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* read to memory
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(nelmts) {
|
||||
buf = (hobj_ref_t *)HDmalloc((unsigned)(nelmts * msize));
|
||||
if(buf==NULL) {
|
||||
@ -201,9 +194,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
} /*nelmts*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* create/write dataset/close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* create/write dataset/close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed");
|
||||
if(nelmts)
|
||||
@ -223,11 +216,10 @@ int do_copy_refobjs(hid_t fidin,
|
||||
} /*H5T_STD_REF_OBJ*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* dataset region references
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG))
|
||||
{
|
||||
* dataset region references
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
else if(H5Tequal(mtype_id, H5T_STD_REF_DSETREG)) {
|
||||
hid_t refobj_id;
|
||||
hdset_reg_ref_t *refbuf = NULL; /* input buffer for region references */
|
||||
hdset_reg_ref_t *buf = NULL; /* output buffer */
|
||||
@ -235,9 +227,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
unsigned u;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* read input to memory
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* read input to memory
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(nelmts) {
|
||||
buf = (hdset_reg_ref_t *)HDmalloc((unsigned)(nelmts * msize));
|
||||
if(buf == NULL) {
|
||||
@ -248,9 +240,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dread failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* create output
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* create output
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */
|
||||
if(refbuf == NULL) {
|
||||
printf("cannot allocate memory\n");
|
||||
@ -289,9 +281,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
} /*nelmts*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* create/write dataset/close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* create/write dataset/close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if((dset_out = H5Dcreate2(fidout, travt->objs[i].name, mtype_id, space_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dcreate2 failed");
|
||||
if(nelmts)
|
||||
@ -310,25 +302,25 @@ int do_copy_refobjs(hid_t fidin,
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_attr failed");
|
||||
} /* H5T_STD_REF_DSETREG */
|
||||
/*-------------------------------------------------------------------------
|
||||
* not references, open previously created object in 1st traversal
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* not references, open previously created object in 1st traversal
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
else {
|
||||
if((dset_out = H5Dopen2(fidout, travt->objs[i].name, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dopen2 failed");
|
||||
} /* end else */
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* copy referenced objects in attributes
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* copy referenced objects in attributes
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(copy_refs_attr(dset_in, dset_out, options, travt, fidout) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "copy_refs_attr failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* check for hard links
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* check for hard links
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(travt->objs[i].nlinks)
|
||||
for(j = 0; j < travt->objs[i].nlinks; j++)
|
||||
H5Lcreate_hard(fidout, travt->objs[i].name, H5L_SAME_LOC, travt->objs[i].links[j].new_name, H5P_DEFAULT, H5P_DEFAULT);
|
||||
@ -338,9 +330,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
} /*can_read*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if(H5Tclose(ftype_id) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
|
||||
if(H5Tclose(mtype_id) < 0)
|
||||
@ -354,9 +346,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_NAMED_DATATYPE
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* H5TRAV_TYPE_NAMED_DATATYPE
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_NAMED_DATATYPE:
|
||||
if((type_in = H5Topen2(fidin, travt->objs[i].name, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Topen2 failed");
|
||||
@ -365,9 +357,9 @@ int do_copy_refobjs(hid_t fidin,
|
||||
break;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* H5TRAV_TYPE_LINK
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* H5TRAV_TYPE_LINK
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
case H5TRAV_TYPE_LINK:
|
||||
/*nothing to do */
|
||||
break;
|
||||
@ -410,27 +402,22 @@ done:
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: copy_refs_attr
|
||||
*
|
||||
* Purpose: duplicate all referenced HDF5 located in attributes
|
||||
* relative to LOC_IN, which is obtained either from
|
||||
* loc_id = H5Gopen2(fid, name, H5P_DEFAULT);
|
||||
* loc_id = H5Dopen2(fid, name, H5P_DEFAULT);
|
||||
* loc_id = H5Topen2(fid, name, H5P_DEFAULT);
|
||||
* Purpose: duplicate all referenced HDF5 located in attributes
|
||||
* relative to LOC_IN, which is obtained either from
|
||||
* loc_id = H5Gopen2(fid, name, H5P_DEFAULT);
|
||||
* loc_id = H5Dopen2(fid, name, H5P_DEFAULT);
|
||||
* loc_id = H5Topen2(fid, name, H5P_DEFAULT);
|
||||
*
|
||||
* Return: 0, ok, -1 no
|
||||
* Return: 0, ok, -1 no
|
||||
*
|
||||
* Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu
|
||||
*
|
||||
* Modifier: xcao@hdfgroup.org, 9/12/2011
|
||||
* Update values of references(object and region) for the following types:
|
||||
* Modified:
|
||||
* Update values of references(object and region) for the following types:
|
||||
* 1) References,
|
||||
* 2) ARRAY of reference,
|
||||
* 3) VLEN of references.
|
||||
* 4) COMPOUND of references.
|
||||
* This function does not handle references in other complicated structures,
|
||||
* such as references in nested compound datatypes.
|
||||
*
|
||||
* Date: October, 28, 2003
|
||||
*
|
||||
* This function does not handle references in other complicated structures,
|
||||
* such as references in nested compound datatypes.
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@ -438,30 +425,32 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
hid_t loc_out,
|
||||
pack_opt_t *options,
|
||||
trav_table_t *travt,
|
||||
hid_t fidout /* for saving references */
|
||||
)
|
||||
hid_t fidout) /* for saving references */
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t attr_id = -1; /* attr ID */
|
||||
hid_t attr_out = -1; /* attr ID */
|
||||
hid_t space_id = -1; /* space ID */
|
||||
hid_t ftype_id = -1; /* file data type ID */
|
||||
hid_t mtype_id = -1; /* memory data type ID */
|
||||
size_t msize; /* memory size of type */
|
||||
hsize_t nelmts; /* number of elements in dataset */
|
||||
hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */
|
||||
char name[255];
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
unsigned u, i, j;
|
||||
int rank;
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t attr_id = -1; /* attr ID */
|
||||
hid_t attr_out = -1; /* attr ID */
|
||||
hid_t space_id = -1; /* space ID */
|
||||
hid_t ftype_id = -1; /* file data type ID */
|
||||
hid_t mtype_id = -1; /* memory data type ID */
|
||||
size_t msize; /* memory size of type */
|
||||
hsize_t nelmts; /* number of elements in dataset */
|
||||
hsize_t dims[H5S_MAX_RANK];/* dimensions of dataset */
|
||||
char name[255];
|
||||
H5O_info_t oinfo; /* Object info */
|
||||
unsigned u, i, j;
|
||||
int rank;
|
||||
H5T_class_t type_class = -1;
|
||||
hbool_t is_ref=0, is_ref_vlen=0, is_ref_array=0, is_ref_comp=0;
|
||||
void *refbuf = NULL;
|
||||
void *buf = NULL;
|
||||
const char* refname = NULL;
|
||||
unsigned *ref_comp_index = NULL;
|
||||
size_t *ref_comp_size = NULL;
|
||||
int ref_comp_field_n = 0;
|
||||
hbool_t is_ref = 0,
|
||||
is_ref_vlen = 0,
|
||||
is_ref_array = 0,
|
||||
is_ref_comp = 0;
|
||||
void *refbuf = NULL;
|
||||
void *buf = NULL;
|
||||
const char *refname = NULL;
|
||||
unsigned *ref_comp_index = NULL;
|
||||
size_t *ref_comp_size = NULL;
|
||||
int ref_comp_field_n = 0;
|
||||
|
||||
|
||||
if(H5Oget_info(loc_in, &oinfo) < 0)
|
||||
@ -492,7 +481,7 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
hid_t base_type;
|
||||
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref_vlen = (H5Tget_class(base_type)==H5T_REFERENCE);
|
||||
is_ref_vlen = (H5Tget_class(base_type) == H5T_REFERENCE);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
}
|
||||
@ -500,7 +489,7 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
hid_t base_type;
|
||||
|
||||
base_type = H5Tget_super(ftype_id);
|
||||
is_ref_array = (H5Tget_class(base_type)==H5T_REFERENCE);
|
||||
is_ref_array = (H5Tget_class(base_type) == H5T_REFERENCE);
|
||||
msize = H5Tget_size(base_type);
|
||||
H5Tclose(base_type);
|
||||
}
|
||||
@ -515,9 +504,9 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
ref_comp_field_n = 0;
|
||||
|
||||
for (i=0; i<(unsigned)nmembers; i++) {
|
||||
hid_t mtid = H5Tget_member_type( ftype_id, i );
|
||||
hid_t mtid = H5Tget_member_type(ftype_id, i);
|
||||
|
||||
if ((H5Tget_class(mtid)==H5T_REFERENCE)) {
|
||||
if ((H5Tget_class(mtid) == H5T_REFERENCE)) {
|
||||
ref_comp_index[ref_comp_field_n] = i;
|
||||
ref_comp_size[ref_comp_field_n] = H5Tget_size(mtid);
|
||||
ref_comp_field_n++;
|
||||
@ -627,9 +616,9 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aread failed");
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* create output
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
* create output
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
refbuf = (hdset_reg_ref_t *)HDcalloc(sizeof(hdset_reg_ref_t), (size_t)nelmts); /*init to zero */
|
||||
if(refbuf == NULL) {
|
||||
printf( "cannot allocate memory\n" );
|
||||
@ -669,7 +658,8 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
HDmemcpy(&(ptr[j]), &ref_out, msize);
|
||||
}
|
||||
} /* for (i=0; i<nelems; i++) */
|
||||
} else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
|
||||
}
|
||||
else if (H5R_DSET_REG_REF_BUF_SIZE == msize) {
|
||||
hdset_reg_ref_t ref_out;
|
||||
|
||||
for (i=0; i<(unsigned)nelmts; i++) {
|
||||
@ -689,8 +679,7 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
buf = HDmalloc((unsigned)(nelmts * msize));
|
||||
refbuf = buf; /* reuse the read buffer for write */
|
||||
|
||||
if(buf == NULL)
|
||||
{
|
||||
if(buf == NULL) {
|
||||
printf( "cannot read into memory\n" );
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "HDmalloc failed");
|
||||
} /* end if */
|
||||
@ -767,8 +756,6 @@ static int copy_refs_attr(hid_t loc_in,
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Aclose failed");
|
||||
} /* for(u = 0; u < (unsigned)oinfo.num_attrs; u++) */
|
||||
|
||||
return ret_value;
|
||||
|
||||
done:
|
||||
if(refbuf)
|
||||
HDfree(refbuf);
|
||||
@ -795,7 +782,7 @@ done:
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: MapIdToName
|
||||
*
|
||||
* Purpose: map a ID from a reference to a dataset name
|
||||
* Purpose: map a ID from a reference to a dataset name
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -803,7 +790,7 @@ static const char*
|
||||
MapIdToName(hid_t refobj_id, trav_table_t *travt)
|
||||
{
|
||||
unsigned int u;
|
||||
const char* ret = NULL;
|
||||
const char *ret = NULL;
|
||||
|
||||
/* linear search */
|
||||
for(u = 0; u < travt->nobjs; u++) {
|
||||
@ -830,18 +817,16 @@ out:
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: Update_Ref_value
|
||||
*
|
||||
* Purpose: Update a reference value
|
||||
*
|
||||
* Programmer: xcao@hdfgroup.org 9/12/2011
|
||||
*
|
||||
* Purpose: Update a reference value
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
static herr_t update_ref_value(hid_t obj_id, H5R_type_t ref_type, void *ref_in,
|
||||
hid_t fid_out, void *ref_out, trav_table_t *travt)
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
const char* ref_obj_name;
|
||||
hid_t space_id=-1, ref_obj_id=-1;
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
const char *ref_obj_name;
|
||||
hid_t space_id = -1;
|
||||
hid_t ref_obj_id = -1;
|
||||
|
||||
ref_obj_id = H5Rdereference2(obj_id, H5P_DEFAULT, ref_type, ref_in);
|
||||
if (ref_obj_id < 0)
|
||||
|
@ -39,22 +39,22 @@ static int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *fil
|
||||
int
|
||||
h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options)
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t fidin = -1; /* file ID for input file*/
|
||||
hid_t fidout = -1; /* file ID for output file*/
|
||||
hid_t did = -1; /* dataset ID */
|
||||
hid_t pid = -1; /* dataset creation property list ID */
|
||||
hid_t sid = -1; /* space ID */
|
||||
hid_t tid = -1; /* type ID */
|
||||
int ok = 1; /* step results */
|
||||
unsigned int i;
|
||||
trav_table_t *travt = NULL;
|
||||
int ok = 1;
|
||||
hid_t fcpl_in = -1; /* file creation property for input file */
|
||||
hid_t fcpl_out = -1; /* file creation property for output file */
|
||||
hid_t fcpl_in = -1; /* file creation property for input file */
|
||||
hid_t fcpl_out = -1; /* file creation property for output file */
|
||||
H5F_fspace_strategy_t in_strategy, out_strategy; /* file space handling strategy for in/output file */
|
||||
hbool_t in_persist, out_persist; /* free-space persist status for in/output file */
|
||||
hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */
|
||||
hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */
|
||||
hbool_t in_persist, out_persist; /* free-space persist status for in/output file */
|
||||
hsize_t in_threshold, out_threshold; /* free-space section threshold for in/output file */
|
||||
hsize_t in_pagesize, out_pagesize; /* file space page size for input/output file */
|
||||
|
||||
/* open the output file */
|
||||
if((fidout = H5Fopen(out_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 )
|
||||
@ -84,7 +84,6 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
if(verify_filters(pid, tid, obj->nfilters, obj->filter) <= 0)
|
||||
ok = 0;
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* layout check
|
||||
*-------------------------------------------------------------------------
|
||||
@ -104,10 +103,8 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
|
||||
if (H5Tclose(tid) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* check for the "all" objects option
|
||||
*-------------------------------------------------------------------------
|
||||
@ -163,7 +160,6 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
ok = 0;
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
@ -177,11 +173,11 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
if (H5Tclose(tid) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Tclose failed");
|
||||
} /* if */
|
||||
|
||||
} /* i */
|
||||
|
||||
/* free table */
|
||||
trav_table_free(travt);
|
||||
travt = NULL;
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
@ -190,39 +186,33 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
*/
|
||||
|
||||
/* open the input file */
|
||||
if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0 )
|
||||
if((fidin = H5Fopen(in_fname, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fopen failed on file <%s>", in_fname);
|
||||
|
||||
/* Get file creation property list for input file */
|
||||
if((fcpl_in = H5Fget_create_plist(fidin)) < 0) {
|
||||
if((fcpl_in = H5Fget_create_plist(fidin)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
|
||||
}
|
||||
|
||||
/* Get file space info for input file */
|
||||
if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0) {
|
||||
if(H5Pget_file_space_strategy(fcpl_in, &in_strategy, &in_persist, &in_threshold) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
|
||||
}
|
||||
|
||||
/* Get file space page size for input file */
|
||||
if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0) {
|
||||
if(H5Pget_file_space_page_size(fcpl_in, &in_pagesize) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size");
|
||||
}
|
||||
|
||||
/* Output file is already opened */
|
||||
/* Get file creation property list for output file */
|
||||
if((fcpl_out = H5Fget_create_plist(fidout)) < 0) {
|
||||
if((fcpl_out = H5Fget_create_plist(fidout)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fget_create_plist failed to retrieve file creation property list");
|
||||
}
|
||||
|
||||
/* Get file space info for output file */
|
||||
if(H5Pget_file_space_strategy(fcpl_out, &out_strategy, &out_persist, &out_threshold) < 0) {
|
||||
if(H5Pget_file_space_strategy(fcpl_out, &out_strategy, &out_persist, &out_threshold) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_strategy failed to retrieve file space strategy & threshold");
|
||||
}
|
||||
|
||||
/* Get file space page size for output file */
|
||||
if(H5Pget_file_space_page_size(fcpl_out, &out_pagesize) < 0) {
|
||||
if(H5Pget_file_space_page_size(fcpl_out, &out_pagesize) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pget_file_space_page_size failed to retrieve file space page size");
|
||||
}
|
||||
|
||||
/*
|
||||
* If -S option is set, the file space handling strategy should be set as specified.
|
||||
@ -230,14 +220,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
* the same as the input file's strategy.
|
||||
*/
|
||||
if(options->fs_strategy) {
|
||||
if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy)) {
|
||||
if(out_strategy != (options->fs_strategy == (H5F_fspace_strategy_t)-1 ? 0 : options->fs_strategy))
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(out_strategy != in_strategy) {
|
||||
if(out_strategy != in_strategy)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space strategy not set as unexpected");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -246,14 +234,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
* the same as the input file's free-space persist status
|
||||
*/
|
||||
if(options->fs_persist) {
|
||||
if(out_persist != (hbool_t)(options->fs_persist == (-1) ? FALSE : options->fs_persist)) {
|
||||
if(out_persist != (hbool_t)(options->fs_persist == (-1) ? FALSE : options->fs_persist))
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(out_persist != in_persist) {
|
||||
if(out_persist != in_persist)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "free-space persist status not set as unexpected");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -262,14 +248,12 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
* input file's threshold size.
|
||||
*/
|
||||
if(options->fs_threshold) {
|
||||
if(out_threshold != (hsize_t)(options->fs_threshold == (-1) ? 0 : options->fs_threshold)) {
|
||||
if(out_threshold != (hsize_t)(options->fs_threshold == (-1) ? 0 : options->fs_threshold))
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected");
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(out_threshold != in_threshold) {
|
||||
if(out_threshold != in_threshold)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "threshold not set as unexpected");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@ -278,27 +262,16 @@ h5repack_verify(const char *in_fname, const char *out_fname, pack_opt_t *options
|
||||
* the same as the input file's file space page size.
|
||||
*/
|
||||
if(options->fs_pagesize) {
|
||||
if(out_pagesize != (hsize_t)(options->fs_pagesize == (-1) ? 0 : options->fs_pagesize)) {
|
||||
if(out_pagesize != (hsize_t)(options->fs_pagesize == (-1) ? 0 : options->fs_pagesize))
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected");
|
||||
}
|
||||
}
|
||||
else { /* "-G" is not set */
|
||||
if(out_pagesize != in_pagesize) {
|
||||
if(out_pagesize != in_pagesize)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "file space page size not set as unexpected");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Closing */
|
||||
if (H5Pclose(fcpl_in) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
|
||||
if (H5Pclose(fcpl_out) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pclose failed");
|
||||
if (H5Fclose(fidin) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed");
|
||||
if (H5Fclose(fidout) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Fclose failed");
|
||||
|
||||
return ok;
|
||||
ret_value = ok;
|
||||
|
||||
done:
|
||||
H5E_BEGIN_TRY {
|
||||
@ -307,6 +280,7 @@ done:
|
||||
H5Pclose(pid);
|
||||
H5Sclose(sid);
|
||||
H5Dclose(did);
|
||||
H5Tclose(tid);
|
||||
H5Fclose(fidin);
|
||||
H5Fclose(fidout);
|
||||
if (travt)
|
||||
@ -319,13 +293,15 @@ done:
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: verify_layout
|
||||
*
|
||||
* Purpose: verify which layout is present in the property list DCPL_ID
|
||||
* Purpose: verify which layout is present in the property list DCPL_ID
|
||||
* H5D_COMPACT = 0
|
||||
* H5D_CONTIGUOUS = 1
|
||||
* H5D_CHUNKED = 2
|
||||
*
|
||||
* H5D_COMPACT = 0
|
||||
* H5D_CONTIGUOUS = 1
|
||||
* H5D_CHUNKED = 2
|
||||
*
|
||||
* Return: 1 has, 0 does not, -1 error
|
||||
* Return:
|
||||
* 1 has,
|
||||
* 0 does not,
|
||||
* -1 error
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@ -342,7 +318,7 @@ int verify_layout(hid_t pid, pack_info_t *obj)
|
||||
return -1;
|
||||
|
||||
/* a non chunked layout was requested on a filtered object */
|
||||
if (nfilters && obj->layout!=H5D_CHUNKED)
|
||||
if (nfilters && obj->layout != H5D_CHUNKED)
|
||||
return 0;
|
||||
|
||||
/* get layout */
|
||||
@ -353,11 +329,11 @@ int verify_layout(hid_t pid, pack_info_t *obj)
|
||||
return 0;
|
||||
|
||||
if (layout==H5D_CHUNKED) {
|
||||
if ((rank = H5Pget_chunk(pid,NELMTS(chsize),chsize/*out*/)) < 0)
|
||||
if ((rank = H5Pget_chunk(pid, NELMTS(chsize), chsize/*out*/)) < 0)
|
||||
return -1;
|
||||
if (obj->chunk.rank != rank)
|
||||
return 0;
|
||||
for ( i=0; i<rank; i++)
|
||||
for (i = 0; i < rank; i++)
|
||||
if (chsize[i] != obj->chunk.chunk_lengths[i])
|
||||
return 0;
|
||||
}
|
||||
@ -368,50 +344,40 @@ int verify_layout(hid_t pid, pack_info_t *obj)
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: h5repack_cmp_pl
|
||||
*
|
||||
* Purpose: compare 2 files for identical property lists of all objects
|
||||
* Purpose: compare 2 files for identical property lists of all objects
|
||||
*
|
||||
* Return: 1=identical, 0=not identical, -1=error
|
||||
* Return:
|
||||
* 1 = identical,
|
||||
* 0 = not identical,
|
||||
* -1 = error
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
int h5repack_cmp_pl(const char *fname1, const char *fname2)
|
||||
{
|
||||
int ret_value = 0; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t fid1=-1; /* file ID */
|
||||
hid_t fid2=-1; /* file ID */
|
||||
hid_t dset1=-1; /* dataset ID */
|
||||
hid_t dset2=-1; /* dataset ID */
|
||||
hid_t gid=-1; /* group ID */
|
||||
hid_t dcpl1=-1; /* dataset creation property list ID */
|
||||
hid_t dcpl2=-1; /* dataset creation property list ID */
|
||||
hid_t gcplid=-1; /* group creation property list */
|
||||
unsigned crt_order_flag1; /* group creation order flag */
|
||||
unsigned crt_order_flag2; /* group creation order flag */
|
||||
trav_table_t *trav=NULL;
|
||||
int ret=1;
|
||||
int ret_value = 1; /*no need to LEAVE() on ERROR: HERR_INIT(int, SUCCEED) */
|
||||
hid_t fid1 =-1; /* file ID */
|
||||
hid_t fid2 =-1; /* file ID */
|
||||
hid_t dset1 =-1; /* dataset ID */
|
||||
hid_t dset2 =-1; /* dataset ID */
|
||||
hid_t gid =-1; /* group ID */
|
||||
hid_t dcpl1 =-1; /* dataset creation property list ID */
|
||||
hid_t dcpl2 =-1; /* dataset creation property list ID */
|
||||
hid_t gcplid =-1; /* group creation property list */
|
||||
unsigned crt_order_flag1; /* group creation order flag */
|
||||
unsigned crt_order_flag2; /* group creation order flag */
|
||||
trav_table_t *trav = NULL;
|
||||
unsigned int i;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* open the files
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* disable error reporting */
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
|
||||
/* Open the files */
|
||||
if ((fid1 = H5Fopen(fname1,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) {
|
||||
error_msg("<%s>: %s\n", fname1, H5FOPENERROR );
|
||||
return -1;
|
||||
}
|
||||
if ((fid2 = H5Fopen(fname2,H5F_ACC_RDONLY,H5P_DEFAULT)) < 0 ) {
|
||||
error_msg("<%s>: %s\n", fname2, H5FOPENERROR );
|
||||
H5Fclose(fid1);
|
||||
return -1;
|
||||
}
|
||||
/* enable error reporting */
|
||||
} H5E_END_TRY;
|
||||
/* Open the files */
|
||||
if ((fid1 = H5Fopen(fname1, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname1, H5FOPENERROR);
|
||||
if ((fid2 = H5Fopen(fname2, H5F_ACC_RDONLY, H5P_DEFAULT)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "h5tools_fopen failed <%s>: %s", fname2, H5FOPENERROR);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* get file table list of objects
|
||||
@ -452,9 +418,8 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
|
||||
if (H5Gclose(gid) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Gclose failed");
|
||||
|
||||
if (crt_order_flag1 != crt_order_flag2) {
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name);
|
||||
}
|
||||
if (crt_order_flag1 != crt_order_flag2)
|
||||
HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name);
|
||||
}
|
||||
else if(trav->objs[i].type == H5TRAV_TYPE_DATASET) {
|
||||
if((dset1 = H5Dopen2(fid1, trav->objs[i].name, H5P_DEFAULT)) < 0)
|
||||
@ -470,12 +435,11 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
|
||||
* compare the property lists
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
if((ret = H5Pequal(dcpl1, dcpl2)) < 0)
|
||||
if((ret_value = H5Pequal(dcpl1, dcpl2)) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Pequal failed");
|
||||
|
||||
if(ret == 0) {
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "property lists failed for <%s> are different",trav->objs[i].name);
|
||||
}
|
||||
if(ret_value == 0)
|
||||
HGOTO_ERROR(0, H5E_tools_min_id_g, "property lists failed for <%s> are different", trav->objs[i].name);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
@ -490,29 +454,8 @@ int h5repack_cmp_pl(const char *fname1, const char *fname2)
|
||||
if(H5Dclose(dset2) < 0)
|
||||
HGOTO_ERROR(FAIL, H5E_tools_min_id_g, "H5Dclose failed");
|
||||
} /*if*/
|
||||
} /*i*/
|
||||
} /*for*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* free
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
trav_table_free(trav);
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* close
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
H5Fclose(fid1);
|
||||
H5Fclose(fid2);
|
||||
|
||||
return ret;
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* error
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
done:
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
@ -524,7 +467,8 @@ done:
|
||||
H5Fclose(fid2);
|
||||
H5Pclose(gcplid);
|
||||
H5Gclose(gid);
|
||||
trav_table_free(trav);
|
||||
if(trav)
|
||||
trav_table_free(trav);
|
||||
} H5E_END_TRY;
|
||||
|
||||
return ret_value;
|
||||
@ -534,14 +478,14 @@ done:
|
||||
/*-------------------------------------------------------------------------
|
||||
* Function: verify_filters
|
||||
*
|
||||
* Purpose: verify if all requested filters in the array FILTER obtained
|
||||
* from user input are present in the property list PID obtained from
|
||||
* the output file
|
||||
* Purpose: verify if all requested filters in the array FILTER obtained
|
||||
* from user input are present in the property list PID obtained from
|
||||
* the output file
|
||||
*
|
||||
* Return:
|
||||
* 1 match
|
||||
* 0 do not match
|
||||
* -1 error
|
||||
* 1 match
|
||||
* 0 do not match
|
||||
* -1 error
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@ -583,6 +527,8 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter)
|
||||
cd_values, sizeof(f_name), f_name, NULL);
|
||||
|
||||
/* filter ID */
|
||||
if (filtn < 0)
|
||||
return -1;
|
||||
if (filtn != filter[i].filtn)
|
||||
return 0;
|
||||
|
||||
@ -657,4 +603,3 @@ int verify_filters(hid_t pid, hid_t tid, int nfilters, filter_info_t *filter)
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -19,9 +19,10 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
|
||||
#add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>)
|
||||
endif ()
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# If plugin library tests can be tested
|
||||
#-----------------------------------------------------------------------------
|
||||
#-----------------------------------------------------------------------------
|
||||
# If plugin library tests can be tested
|
||||
#-----------------------------------------------------------------------------
|
||||
if (BUILD_SHARED_LIBS)
|
||||
set (HDF5_TOOL_PLUGIN_LIB_CORENAME "dynlibdiff")
|
||||
set (HDF5_TOOL_PLUGIN_LIB_NAME "${HDF5_EXTERNAL_LIB_PREFIX}${HDF5_TOOL_PLUGIN_LIB_CORENAME}")
|
||||
set (HDF5_TOOL_PLUGIN_LIB_TARGET ${HDF5_TOOL_PLUGIN_LIB_CORENAME})
|
||||
@ -46,5 +47,6 @@ INCLUDE_DIRECTORIES (${HDF5_TOOLS_DIR}/lib)
|
||||
"$<TARGET_FILE:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
|
||||
"${CMAKE_BINARY_DIR}/plugins/$<TARGET_FILE_NAME:${HDF5_TOOL_PLUGIN_LIB_TARGET}>"
|
||||
)
|
||||
endif ()
|
||||
|
||||
include (CMakeTests.cmake)
|
||||
include (CMakeTests.cmake)
|
||||
|
@ -501,7 +501,7 @@
|
||||
add_test (
|
||||
NAME H5DIFF_UD-${testname}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
|
||||
-D "TEST_ARGS:STRING=${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
|
||||
-D "TEST_OUTPUT=${resultfile}.out"
|
||||
@ -516,7 +516,7 @@
|
||||
add_test (
|
||||
NAME H5DIFF_UD-${testname}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
|
||||
-D "TEST_ARGS:STRING=${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
|
||||
-D "TEST_OUTPUT=${resultfile}.out"
|
||||
@ -546,7 +546,7 @@
|
||||
add_test (
|
||||
NAME H5DIFF_UD_ERR-${testname}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
|
||||
-D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
|
||||
-D "TEST_OUTPUT=${resultfile}_ERR.out"
|
||||
@ -562,7 +562,7 @@
|
||||
add_test (
|
||||
NAME H5DIFF_UD_ERR-${testname}
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff>"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>"
|
||||
-D "TEST_ARGS:STRING=--enable-error-stack;${ARGN}"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
|
||||
-D "TEST_OUTPUT=${resultfile}_ERR.out"
|
||||
@ -1653,8 +1653,10 @@ ADD_H5_TEST (h5diff_v3 0 -c ${FILEV1} ${FILEV2})
|
||||
##############################################################################
|
||||
### P L U G I N T E S T S
|
||||
##############################################################################
|
||||
ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
|
||||
ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
|
||||
if (BUILD_SHARED_LIBS)
|
||||
ADD_H5_UD_TEST (h5diff_plugin_test 0 h5diff_ud -v tudfilter.h5 tudfilter2.h5)
|
||||
ADD_H5_UD_TEST (h5diff_plugin_fail 2 h5diff_udfail -v tudfilter.h5 tudfilter2.h5)
|
||||
endif ()
|
||||
|
||||
# ##############################################################################
|
||||
# # END
|
||||
|
@ -287,9 +287,9 @@ typedef struct s1_t {
|
||||
#define F64_DIM1 (F64_ARRAY_BUF_LEN / sizeof(int) + 1)
|
||||
|
||||
/* File 65 macros */
|
||||
#define STRATEGY H5F_FSPACE_STRATEGY_NONE /* File space handling strategy */
|
||||
#define THRESHOLD10 10 /* Free-space section threshold */
|
||||
#define FSPACE_PAGE_SIZE 8192 /* File space page size */
|
||||
#define STRATEGY H5F_FSPACE_STRATEGY_NONE /* File space handling strategy */
|
||||
#define THRESHOLD10 10 /* Free-space section threshold */
|
||||
#define FSPACE_PAGE_SIZE 8192 /* File space page size */
|
||||
|
||||
/* "FILE66" macros and for FILE69 */
|
||||
#define F66_XDIM 8
|
||||
|
@ -1377,11 +1377,7 @@
|
||||
ADD_H5_UD_TEST (plugin_test 0 h5repack_layout.h5 -v -f UD=257,0,1,9)
|
||||
ADD_H5_UD_TEST (plugin_none 0 h5repack_layout.UD.h5 -v -f NONE)
|
||||
# check for no parameters
|
||||
set (TESTRETVAL 255)
|
||||
if (WIN32)
|
||||
set (TESTRETVAL -1)
|
||||
endif ()
|
||||
ADD_H5_UD_TEST (plugin_zero ${TESTRETVAL} h5repack_layout.h5 -v -f UD=250,0,0)
|
||||
ADD_H5_UD_TEST (plugin_zero 0 h5repack_layout.h5 -v -f UD=250,0,0)
|
||||
|
||||
if (HDF5_TEST_VFD)
|
||||
# Run test with different Virtual File Driver
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -76,8 +76,8 @@ GROUP "/" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CHUNKED ( 20, 10 )
|
||||
SIZE 1283 (2.494:1 COMPRESSION)
|
||||
CHUNKED ( 40, 20 )
|
||||
SIZE 1150 (2.783:1 COMPRESSION)
|
||||
}
|
||||
FILTERS {
|
||||
COMPRESSION DEFLATE { LEVEL 1 }
|
||||
|
@ -1,7 +1,8 @@
|
||||
Objects to modify layout are...
|
||||
Objects to apply filter are...
|
||||
No all objects to modify layout
|
||||
No all objects to apply filter
|
||||
</dset_deflate> with GZIP filter
|
||||
</dset_deflate>...Found
|
||||
Making new file ...
|
||||
-----------------------------------------
|
||||
Type Filter (Compression) Name
|
||||
-----------------------------------------
|
||||
|
@ -92,7 +92,7 @@ GROUP "/" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CHUNKED ( 20, 10 )
|
||||
CHUNKED ( 40, 20 )
|
||||
SIZE 3200 (1.000:1 COMPRESSION)
|
||||
}
|
||||
FILTERS {
|
||||
|
@ -11,7 +11,7 @@ GROUP "/" {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
@ -33,7 +33,7 @@ GROUP "/" {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
@ -55,7 +55,7 @@ GROUP "/" {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
@ -77,7 +77,7 @@ GROUP "/" {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
@ -92,14 +92,14 @@ GROUP "/" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CHUNKED ( 20, 10 )
|
||||
CHUNKED ( 40, 20 )
|
||||
SIZE 3200 (1.000:1 COMPRESSION)
|
||||
}
|
||||
FILTERS {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
@ -121,7 +121,7 @@ GROUP "/" {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
@ -143,7 +143,7 @@ GROUP "/" {
|
||||
USER_DEFINED_FILTER {
|
||||
FILTER_ID 260
|
||||
COMMENT dynlib4
|
||||
PARAMS { 9 1 10 2 }
|
||||
PARAMS { 9 1 11 0 }
|
||||
}
|
||||
}
|
||||
FILLVALUE {
|
||||
|
@ -1,4 +1,135 @@
|
||||
HDF5 "out-plugin_zero.h5repack_layout.h5" {
|
||||
GROUP "/" {
|
||||
DATASET "dset1" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CONTIGUOUS
|
||||
SIZE 3200
|
||||
OFFSET 2048
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_LATE
|
||||
}
|
||||
}
|
||||
DATASET "dset2" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CONTIGUOUS
|
||||
SIZE 3200
|
||||
OFFSET 5248
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_LATE
|
||||
}
|
||||
}
|
||||
DATASET "dset3" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CONTIGUOUS
|
||||
SIZE 3200
|
||||
OFFSET 8448
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_LATE
|
||||
}
|
||||
}
|
||||
DATASET "dset4" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CONTIGUOUS
|
||||
SIZE 3200
|
||||
OFFSET 13696
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_LATE
|
||||
}
|
||||
}
|
||||
DATASET "dset_chunk" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CHUNKED ( 20, 10 )
|
||||
SIZE 3200
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_INCR
|
||||
}
|
||||
}
|
||||
DATASET "dset_compact" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
COMPACT
|
||||
SIZE 3200
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_EARLY
|
||||
}
|
||||
}
|
||||
DATASET "dset_contiguous" {
|
||||
DATATYPE H5T_STD_I32LE
|
||||
DATASPACE SIMPLE { ( 40, 20 ) / ( 40, 20 ) }
|
||||
STORAGE_LAYOUT {
|
||||
CONTIGUOUS
|
||||
SIZE 3200
|
||||
OFFSET 26184
|
||||
}
|
||||
FILTERS {
|
||||
NONE
|
||||
}
|
||||
FILLVALUE {
|
||||
FILL_TIME H5D_FILL_TIME_IFSET
|
||||
VALUE H5D_FILL_VALUE_DEFAULT
|
||||
}
|
||||
ALLOCATION_TIME {
|
||||
H5D_ALLOC_TIME_LATE
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
Objects to modify layout are...
|
||||
Objects to apply filter are...
|
||||
No all objects to modify layout
|
||||
All objects to apply filter are...
|
||||
Uncompress all
|
||||
Making new file ...
|
||||
-----------------------------------------
|
||||
Type Filter (Compression) Name
|
||||
-----------------------------------------
|
||||
|
@ -1,6 +1,7 @@
|
||||
Objects to modify layout are...
|
||||
Objects to apply filter are...
|
||||
No all objects to modify layout
|
||||
All objects to apply filter are...
|
||||
User Defined 257
|
||||
Making new file ...
|
||||
-----------------------------------------
|
||||
Type Filter (Compression) Name
|
||||
-----------------------------------------
|
||||
|
@ -1,6 +1,7 @@
|
||||
Objects to modify layout are...
|
||||
Objects to apply filter are...
|
||||
No all objects to modify layout
|
||||
All objects to apply filter are...
|
||||
User Defined 260
|
||||
Making new file ...
|
||||
-----------------------------------------
|
||||
Type Filter (Compression) Name
|
||||
-----------------------------------------
|
||||
|
@ -1,7 +1,22 @@
|
||||
Objects to modify layout are...
|
||||
Objects to apply filter are...
|
||||
No all objects to modify layout
|
||||
All objects to apply filter are...
|
||||
User Defined 250
|
||||
Making new file ...
|
||||
-----------------------------------------
|
||||
Type Filter (Compression) Name
|
||||
-----------------------------------------
|
||||
group /
|
||||
warning: could not create dataset </dset1>. Applying original settings
|
||||
dset /dset1
|
||||
warning: could not create dataset </dset2>. Applying original settings
|
||||
dset /dset2
|
||||
warning: could not create dataset </dset3>. Applying original settings
|
||||
dset /dset3
|
||||
warning: could not create dataset </dset4>. Applying original settings
|
||||
dset /dset4
|
||||
warning: could not create dataset </dset_chunk>. Applying original settings
|
||||
dset /dset_chunk
|
||||
warning: could not create dataset </dset_compact>. Applying original settings
|
||||
dset /dset_compact
|
||||
warning: could not create dataset </dset_contiguous>. Applying original settings
|
||||
dset /dset_contiguous
|
||||
|
Loading…
x
Reference in New Issue
Block a user