From b829420a0d6b63f46c923d8c622d3cd451faece7 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Jun 2017 12:22:52 -0500 Subject: HDFFV-10219: Added keyword SUBSET to h5import list. --- MANIFEST | 2 + release_docs/RELEASE.txt | 9 + tools/src/h5import/h5import.c | 333 ++++++++++++++++++++++++---- tools/test/h5import/CMakeTests.cmake | 82 +++++++ tools/test/h5import/testfiles/tall_fp32.ddl | 28 +++ tools/test/h5import/testfiles/tall_i32.ddl | 32 +++ 6 files changed, 446 insertions(+), 40 deletions(-) create mode 100644 tools/test/h5import/testfiles/tall_fp32.ddl create mode 100644 tools/test/h5import/testfiles/tall_i32.ddl diff --git a/MANIFEST b/MANIFEST index c34e614..5018a12 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1289,6 +1289,8 @@ ./tools/test/h5import/testfiles/binuin16.h5 ./tools/test/h5import/testfiles/binuin32.conf ./tools/test/h5import/testfiles/binuin32.h5 +./tools/test/h5import/testfiles/tall_fp32.ddl +./tools/test/h5import/testfiles/tall_i32.ddl ./tools/test/h5import/testfiles/textpfe.conf ./tools/test/h5import/testfiles/textpfe.h5 ./tools/test/h5import/testfiles/textpfe64.txt diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index e52913f..35cf372 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -117,6 +117,15 @@ Bug Fixes since HDF5-1.10.1 release Tools ----- + - h5import + + h5import crashed trying to import data from a subset of a dataset. + + Improved h5import by adding the SUBSET keyword. h5import understands + to use the Count times the Block as the size of the dimensions. + + (ADB - 2017/06/12, HDFFV-102191) + - h5repack h5repack did not maintain the creation order flag of the root diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index c71aeef..0f7be3d 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -17,6 +17,7 @@ #include #include #include +#include #include "h5import.h" #include "h5tools.h" #include "h5tools_utils.h" @@ -66,6 +67,12 @@ static int allocateUIntegerStorage(struct Input *in); static int validateConfigurationParameters(struct Input *in); static int processStrData(FILE *strm, struct Input *in, hid_t file_id); static int processStrHDFData(FILE *strm, struct Input *in, hid_t file_id); +uint16_t swap_uint16(uint16_t val); +int16_t swap_int16(int16_t val); +uint32_t swap_uint32(uint32_t val); +int32_t swap_int32(int32_t val); +int64_t swap_int64(int64_t val); +uint64_t swap_uint64(uint64_t val); int main(int argc, char *argv[]) { @@ -226,7 +233,7 @@ int main(int argc, char *argv[]) if (process(&opt) == -1) goto err; - + for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); if (in->sizeOfDimension) @@ -242,7 +249,7 @@ int main(int argc, char *argv[]) } return (EXIT_SUCCESS); -err: +err: (void) HDfprintf(stderr, "%s", err4); for (i = 0; i < opt.fcount; i++) { in = &(opt.infiles[i].in); @@ -450,10 +457,12 @@ static int readIntegerData(FILE *strm, struct Input *in) { H5DT_INT8 *in08; H5DT_INT16 *in16; - H5DT_INT16 temp; + H5DT_INT16 temp16; H5DT_INT32 *in32; + H5DT_INT32 temp32; #ifdef H5_SIZEOF_LONG_LONG H5DT_INT64 *in64; + H5DT_INT64 temp64; char buffer[256]; #endif hsize_t len = 1; @@ -473,11 +482,11 @@ static int readIntegerData(FILE *strm, struct Input *in) case 0: /* TEXTIN */ in08 = (H5DT_INT8 *) in->data; for (i = 0; i < len; i++, in08++) { - if (fscanf(strm, "%hd", &temp) != 1) { + if (fscanf(strm, "%hd", &temp16) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } - (*in08) = (H5DT_INT8) temp; + (*in08) = (H5DT_INT8) temp16; } break; @@ -488,6 +497,9 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } +#ifdef H5DEBUGIMPORT2 + printf("readIntegerData %d (0x%.8X)\n", *in08, *in08); +#endif } break; @@ -512,10 +524,17 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *) in16, sizeof(H5DT_INT16), 1, strm) != 1) { + if (HDfread((char *)&temp16, sizeof(H5DT_INT16), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *in16 = temp16; + else + *in16 = swap_int16(temp16); +#ifdef H5DEBUGIMPORT2 + printf("readIntegerData %d (0x%.8X)\n", *in16, temp16); +#endif } break; @@ -539,10 +558,17 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *) in32, sizeof(H5DT_INT32), 1, strm) != 1) { + if (HDfread((char *)&temp32, sizeof(H5DT_INT32), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *in32 = temp32; + else + *in32 = swap_int32(temp32); +#ifdef H5DEBUGIMPORT + printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); +#endif } break; @@ -568,10 +594,17 @@ static int readIntegerData(FILE *strm, struct Input *in) case 4: /* IN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *) in64, sizeof(H5DT_INT64), 1, strm) != 1) { + if (HDfread((char *)&temp64, sizeof(H5DT_INT64), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *in64 = temp64; + else + *in64 = swap_int64(temp64); +#ifdef H5DEBUGIMPORT2 + printf("readIntegerData %d (0x%.8X)\n", *in64, temp64); +#endif } break; @@ -593,10 +626,12 @@ static int readUIntegerData(FILE *strm, struct Input *in) { H5DT_UINT8 *in08; H5DT_UINT16 *in16; - H5DT_UINT16 temp; + H5DT_UINT16 temp16; H5DT_UINT32 *in32; + H5DT_UINT32 temp32; #ifdef H5_SIZEOF_LONG_LONG H5DT_UINT64 *in64; + H5DT_UINT64 temp64; char buffer[256]; #endif hsize_t len = 1; @@ -615,11 +650,11 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 6: /* TEXTUIN */ in08 = (H5DT_UINT8 *) in->data; for (i = 0; i < len; i++, in08++) { - if (fscanf(strm, "%hu", &temp) != 1) { + if (fscanf(strm, "%hu", &temp16) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } - (*in08) = (H5DT_UINT8) temp; + (*in08) = (H5DT_UINT8) temp16; } break; @@ -653,10 +688,14 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in16++) { - if (HDfread((char *) in16, sizeof(H5DT_UINT16), 1, strm) != 1) { + if (HDfread((char *)&temp16, sizeof(H5DT_UINT16), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *in16 = temp16; + else + *in16 = swap_uint16(temp16); } break; @@ -680,10 +719,14 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in32++) { - if (HDfread((char *) in32, sizeof(H5DT_UINT32), 1, strm) != 1) { + if (HDfread((char *)&temp32, sizeof(H5DT_UINT32), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *in32 = temp32; + else + *in32 = swap_uint32(temp32); } break; @@ -709,10 +752,14 @@ static int readUIntegerData(FILE *strm, struct Input *in) case 7: /* UIN */ for (i = 0; i < len; i++, in64++) { - if (HDfread((char *) in64, sizeof(H5DT_UINT64), 1, strm) != 1) { + if (HDfread((char *)&temp64, sizeof(H5DT_UINT64), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *in64 = temp64; + else + *in64 = swap_uint64(temp64); } break; @@ -733,12 +780,16 @@ static int readUIntegerData(FILE *strm, struct Input *in) static int readFloatData(FILE *strm, struct Input *in) { H5DT_FLOAT32 *fp32; + uint32_t *bfp32; + uint32_t temp32; H5DT_FLOAT64 *fp64; + uint64_t *bfp64; + uint64_t temp64; hsize_t len = 1; hsize_t i; int j; - const char *err1 = "Unable to get integer value from file.\n"; + const char *err1 = "Unable to get float value from file.\n"; const char *err2 = "Unrecognized input class type.\n"; const char *err3 = "Invalid input size type.\n"; @@ -774,11 +825,19 @@ static int readFloatData(FILE *strm, struct Input *in) break; case 3: /* FP */ - for (i = 0; i < len; i++, fp32++) { - if (HDfread((char *) fp32, sizeof(H5DT_FLOAT32), 1, strm) != 1) { + bfp32 = (uint32_t *) in->data; + for (i = 0; i < len; i++, bfp32++) { + if (HDfread((char *)&temp32, sizeof(uint32_t), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *bfp32 = temp32; + else + *bfp32 = swap_uint32(temp32); +#ifdef H5DEBUGIMPORT + printf("readFloatData %f (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); +#endif } break; @@ -816,11 +875,19 @@ static int readFloatData(FILE *strm, struct Input *in) break; case 3: /* FP */ - for (i = 0; i < len; i++, fp64++) { - if (HDfread((char *) fp64, sizeof(H5DT_FLOAT64), 1, strm) != 1) { + bfp64 = (uint64_t *) in->data; + for (i = 0; i < len; i++, bfp64++) { + if (HDfread((char *)&temp64, sizeof(uint64_t), 1, strm) != 1) { (void) HDfprintf(stderr, "%s", err1); return (-1); } + if (in->outputByteOrder) + *bfp64 = temp64; + else + *bfp64 = swap_uint64(temp64); +#ifdef H5DEBUGIMPORT2 + printf("readFloatData %lf (0x%.8X)\n", fp64, temp64); +#endif } break; @@ -897,7 +964,7 @@ static int processStrData(FILE *strm, struct Input *in, hid_t file_id) goto out; /* disable error reporting */ - H5E_BEGIN_TRY + H5E_BEGIN_TRY { /* create parent groups */ if (in->path.count > 1) { @@ -1321,6 +1388,7 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err17 = "Configuration parameters are invalid in %s.\n"; const char *err18 = "Unable to get string value.\n"; const char *err19 = "Unable to get integer value.\n"; + const char *err20 = "Unable to get subset values.\n"; /* create vector to map which keywords have been found check vector after each keyword to check for violation @@ -1852,6 +1920,151 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("h5dump FILTERS %s found\n", temp); #endif } + else if(!HDstrcmp("SUBSET", key)) { /* reduce dimensions */ + hsize_t temp_dims[MAX_NUM_DIMENSION]; + int get_next_prop = 1; +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET key\n"); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if (fscanf(strm, "%s", temp) != 1) { /* SUBSET keyword */ + (void) HDfprintf(stderr, "%s", err18); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + while (get_next_prop) { + if(!HDstrcmp("COUNT", temp)) { /* COUNT */ + int icount = 0; + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if(!HDstrcmp("(", temp)) { /* start paren */ + int get_next_dim = 1; + int i = 0; + + if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */ + (void) HDfprintf(stderr, err16c, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET COUNT [%s] found\n", temp); +#endif + while (get_next_dim) { + char *more = temp; + temp_dims[icount] = HDstrtoull(more, &more, 10); + if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET COUNT %s found\n", temp); +#endif + if(!HDstrcmp(");", temp)) { /* end paren */ + in->rank = ++icount; + in->configOptionVector[RANK] = 1; + get_next_dim = 0; + } + else { /* Dimension */ + icount++; + if (icount > MAX_NUM_DIMENSION) { + (void) HDfprintf(stderr, "Invalid value for rank.\n"); + goto error; + } + } + } /* while (get_next_dim) */ + for (i = 0; i < in->rank; i++) { + in->sizeOfDimension[i] = temp_dims[i]; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET COUNT dims: [%d]", in->rank); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %d", in->sizeOfDimension[pndx]); + } + printf("\n"); +#endif + in->configOptionVector[DIM] = 1; + } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!HDstrcmp("COUNT", temp)) COUNT */ + if(!HDstrcmp("BLOCK", temp)) { /* BLOCK */ + int icount = 0; + if (fscanf(strm, "%s", temp) != 1) { /* start paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if(!HDstrcmp("(", temp)) { /* start paren */ + int get_next_dim = 1; + int i = 0; + + if (fscanf(strm, "%s", temp) != 1) { /* Dimension with optional comma */ + (void) HDfprintf(stderr, err16c, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET BLOCK [%s] found\n", temp); +#endif + while (get_next_dim) { + char *more = temp; + temp_dims[icount] = HDstrtoull(more, &more, 10); + if (fscanf(strm, "%s", temp) != 1) { /* Dimension or end paren */ + (void) HDfprintf(stderr, err6b, infile); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET BLOCK %s found\n", temp); +#endif + if(!HDstrcmp(");", temp)) { /* end paren */ + in->rank = ++icount; + in->configOptionVector[RANK] = 1; + get_next_dim = 0; + } + else { /* Dimension */ + icount++; + if (icount > MAX_NUM_DIMENSION) { + (void) HDfprintf(stderr, "Invalid value for rank.\n"); + goto error; + } + } + } /* while (get_next_dim) */ + for (i = 0; i < in->rank; i++) { + in->sizeOfDimension[i] = in->sizeOfDimension[i] * temp_dims[i]; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET BLOCK dims: [%d]", in->rank); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %d", in->sizeOfDimension[pndx]); + } + printf("\n"); +#endif + in->configOptionVector[DIM] = 1; + } /* if(!HDstrcmp("(", key)) start paren */ + } /* if(!HDstrcmp("BLOCK", temp)) BLOCK */ + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err18); + goto error; + } +#ifdef H5DEBUGIMPORT + printf("h5dump SUBSET %s found\n", temp); +#endif + if(!HDstrcmp("}", temp)) { /* end bracket */ + get_next_prop = 0; + } + } /* while (get_next_prop) */ + } /* else if(!HDstrcmp("SUBSET", key)) */ else if(!HDstrcmp("DATA", key)) { /* FINSHED */ #ifdef H5DEBUGIMPORT printf("h5dump DATA key\n"); @@ -1877,13 +2090,16 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("h5dump compressionType=%d\n", in->compressionType); printf("h5dump compressionParam=%d\n", in->compressionParam); printf("h5dump externFilename=%s\n", in->externFilename); - printf("h5dump configOptionVector:\n"); - for (pndx = 0; pndx < NUM_KEYS; pndx++) { - printf(" %s=%d\n", keytable[pndx], in->configOptionVector[pndx]); + printf("h5dump sizeOfDimensions:\n"); + for (pndx = 0; pndx < in->rank; pndx++) { + printf(" %d\n", in->sizeOfDimension[pndx]); } #endif } else { +#ifdef H5DEBUGIMPORT + printf("original option keyword parsing\n"); +#endif while (scanret == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) { (void) HDfprintf(stderr, err2, infile); @@ -2126,16 +2342,16 @@ static int processConfigurationFile(char *infile, struct Input *in) } scanret = fscanf(strm, "%s", key); } - } - /* - check if keywords obtained are valid - if yes, return 0 else error - */ + /* + check if keywords obtained are valid + if yes, return 0 else error + */ - if (validateConfigurationParameters(in) == -1) { - (void) HDfprintf(stderr, err17, infile); - goto error; + if (validateConfigurationParameters(in) == -1) { + (void) HDfprintf(stderr, err17, infile); + goto error; + } } /* Set success return value */ @@ -3062,8 +3278,9 @@ static int getInputClassType(struct Input *in, char * buffer) if (in->configOptionVector[OUTPUT_SIZE] == 0) in->outputSize = in->inputSize; #ifdef H5DEBUGIMPORT - printf("h5dump DATATYPE STRING %d inputSize\n", in->inputSize); - printf("h5dump DATATYPE STRING %d outputSize\n", in->outputSize); + printf("h5dump DATATYPE InClass %d inputSize\n", in->inputSize); + printf("h5dump DATATYPE InClass %d outputSize\n", in->outputSize); + printf("h5dump DATATYPE InClass %d outputArchitecture\n", in->outputArchitecture); #endif in->inputClass = kindex; @@ -3382,7 +3599,7 @@ hid_t createOutputDataType(struct Input *in) const char *err1 = "Invalid value for output class.\n"; const char *err2 = "Invalid value for output size.\n"; const char *err3 = "Invalid value for output byte order.\n"; - const char *err4 = "Invalid value for output architecture.\n"; + const char *err4 = "Invalid value for output architecture.\n"; const char *err5 = "STD not supported for float.\n"; const char *err6 = "IEEE not supported for INT.\n"; @@ -3504,9 +3721,9 @@ hid_t createOutputDataType(struct Input *in) } break; - default: - (void) HDfprintf(stderr, "%s", err4); - return (-1); + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); } break; @@ -3589,9 +3806,9 @@ hid_t createOutputDataType(struct Input *in) } break; - default: - (void) HDfprintf(stderr, "%s", err4); - return (-1); + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); } break; @@ -3971,6 +4188,42 @@ static int process(struct Options *opt) return (0); } +uint16_t swap_uint16( uint16_t val) +{ + return (val << 8) | (val >> 8); +} + +int16_t swap_int16(int16_t val) +{ + return (val << 8) | ((val >> 8) & 0xFF); +} + +uint32_t swap_uint32(uint32_t val) +{ + val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); + return (val << 16) | (val >> 16); +} + +int32_t swap_int32(int32_t val) +{ + val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); + return (val << 16) | ((val >> 16) & 0xFFFF); +} + +int64_t swap_int64(int64_t val) +{ + val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL); + val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL); + return (val << 32) | ((val >> 32) & 0xFFFFFFFFULL); +} + +uint64_t swap_uint64(uint64_t val) +{ + val = ((val << 8) & 0xFF00FF00FF00FF00ULL) | ((val >> 8) & 0x00FF00FF00FF00FFULL); + val = ((val << 16) & 0xFFFF0000FFFF0000ULL) | ((val >> 16) & 0x0000FFFF0000FFFFULL); + return (val << 32) | (val >> 32); +} + /* * Name: * help diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 27c736a..1abd7d6 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -52,6 +52,8 @@ dbinuin16.h5.txt dbinuin32.h5.txt dtxtstr.h5.txt + tall_fp32.ddl + tall_i32.ddl ) set (HDF5_REFERENCE_TEST_FILES binfp64.h5 @@ -71,6 +73,9 @@ txtstr.h5 textpfe.h5 ) + set (HDF5_TOOLS_TEST_FILES + tall.h5 + ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") foreach (conf_file ${HDF5_REFERENCE_CONF_FILES}) @@ -84,6 +89,10 @@ foreach (h5_file ${HDF5_REFERENCE_TEST_FILES}) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5IMPORT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5import_files") endforeach () + + foreach (h5_file ${HDF5_TOOLS_TEST_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" "h5import_files") + endforeach () add_custom_target(h5import_files ALL COMMENT "Copying files needed by h5import tests" DEPENDS ${h5import_files_list}) ############################################################################## @@ -104,6 +113,11 @@ COMMAND ${CMAKE_COMMAND} -E remove ${testfile} + ${testfile}.new + ${testfile}.new.err + ${testfile}.out + ${testfile}.out.err + ${testfile} ) set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) @@ -148,6 +162,12 @@ -E remove d${testfile} d${testfile}.bin + d${testfile}.dmp + d${testfile}.dmp.err + d${testfile}.imp + d${testfile}.imp.err + d${testfile}.dff + d${testfile}.dff.err ) set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) @@ -207,6 +227,64 @@ endif () endmacro () + macro (ADD_H5_DUMPSUBTEST testname testfile datasetname) + # If using memchecker skip tests + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove + d-${testname}.dmp + d-${testname}.dmp.err + d-${testname}.h5 + ${testname}.dmp + ${testname}.dmp.err + ${testname}.imp + ${testname}.imp.err + ${testname}.bin + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};--ddl=${testname}.dmp;-o;${testname}.bin;-b;FILE;testfiles/${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testname}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects") + + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=${testname}.imp" + -D "TEST_EXPECT=0" + -D "TEST_SKIP_COMPARE=TRUE" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP") + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-CMP + COMMAND "${CMAKE_COMMAND}" + -D "TEST_PROGRAM=$" + -D "TEST_ARGS:STRING=-p;d-${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" + -D "TEST_OUTPUT=d-${testname}.dmp" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=testfiles/${testname}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP") + endif () + endmacro () + macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( @@ -474,3 +552,7 @@ # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " ADD_H5_TEST (ASCII_F64_R1 testfiles/textpfe64.txt testfiles/textpfe.conf textpfe.h5) + # ----- TESTING "Binary Subset " + ADD_H5_DUMPSUBTEST (tall_fp32 tall.h5 /g2/dset2.2 --start=1,1 --stride=2,3 --count=1,2 --block=1,1) + ADD_H5_DUMPSUBTEST (tall_i32 tall.h5 /g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1) + diff --git a/tools/test/h5import/testfiles/tall_fp32.ddl b/tools/test/h5import/testfiles/tall_fp32.ddl new file mode 100644 index 0000000..2a0dc1b --- /dev/null +++ b/tools/test/h5import/testfiles/tall_fp32.ddl @@ -0,0 +1,28 @@ +HDF5 "d-tall_fp32.h5" { +GROUP "/" { + GROUP "g2" { + DATASET "dset2.2" { + DATATYPE H5T_IEEE_F32BE + DATASPACE SIMPLE { ( 1, 2 ) / ( 1, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 8 + OFFSET 2432 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + (0,0): 0.2, 0.8 + } + } + } +} +} diff --git a/tools/test/h5import/testfiles/tall_i32.ddl b/tools/test/h5import/testfiles/tall_i32.ddl new file mode 100644 index 0000000..d9280bc --- /dev/null +++ b/tools/test/h5import/testfiles/tall_i32.ddl @@ -0,0 +1,32 @@ +HDF5 "d-tall_i32.h5" { +GROUP "/" { + GROUP "g1" { + GROUP "g1.1" { + DATASET "dset1.1.1" { + DATATYPE H5T_STD_I32BE + DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 3464 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + (0,0): 1, 4, + (1,0): 3, 12, + (2,0): 5, 20 + } + } + } + } +} +} -- cgit v0.12 From 61517c796f0e8656c5f791784d88dc656f468af5 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 12 Jun 2017 12:53:51 -0500 Subject: HDFFV-10219: add generated files to memcheck clear command --- tools/test/h5import/CMakeTests.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 1abd7d6..89685fa 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -464,6 +464,22 @@ dtxtstr.h5.dmp.err dtxtstr.h5.dff dtxtstr.h5.dff.err + tall_fp32.dmp + tall_fp32.dmp.err + tall_fp32.bin + tall_fp32.imp + tall_fp32.imp.err + d-tall_fp32.dmp + d-tall_fp32.dmp.err + d-tall_fp32.h5 + tall_i32.dmp + tall_i32.dmp.err + tall_i32.bin + tall_i32.imp + tall_i32.imp.err + d-tall_i32.dmp + d-tall_i32.dmp.err + d-tall_i32.h5 ) set (last_test "H5IMPORT-clear-objects") endif () -- cgit v0.12 From c288898630149fe913525341fff13bde9f02d80b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 12:19:46 -0500 Subject: HDFFV-10219 - fix for native in bin file and possible non-native in h5 --- MANIFEST | 8 +- tools/src/h5import/CMakeLists.txt | 2 +- tools/src/h5import/h5import.c | 724 ++++++++++++++++++++--- tools/src/h5import/h5import.h | 7 +- tools/test/h5import/CMakeTests.cmake | 32 +- tools/test/h5import/h5importtest.c | 131 +++- tools/test/h5import/testfiles/binfp64.conf | 13 - tools/test/h5import/testfiles/binin16.conf | 12 - tools/test/h5import/testfiles/binin32.conf | 12 - tools/test/h5import/testfiles/binin32.h5 | Bin 9472 -> 6920 bytes tools/test/h5import/testfiles/binin8.conf | 16 - tools/test/h5import/testfiles/binin8w.conf | 9 - tools/test/h5import/testfiles/binuin16.conf | 12 - tools/test/h5import/testfiles/binuin32.conf | 12 - tools/test/h5import/testfiles/tintsattrs_u32.ddl | 28 + 15 files changed, 790 insertions(+), 228 deletions(-) delete mode 100644 tools/test/h5import/testfiles/binfp64.conf delete mode 100644 tools/test/h5import/testfiles/binin16.conf delete mode 100644 tools/test/h5import/testfiles/binin32.conf delete mode 100644 tools/test/h5import/testfiles/binin8.conf delete mode 100644 tools/test/h5import/testfiles/binin8w.conf delete mode 100644 tools/test/h5import/testfiles/binuin16.conf delete mode 100644 tools/test/h5import/testfiles/binuin32.conf create mode 100644 tools/test/h5import/testfiles/tintsattrs_u32.ddl diff --git a/MANIFEST b/MANIFEST index 5018a12..b890352 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1275,22 +1275,16 @@ ./tools/test/h5import/h5importtestutil.sh.in # testfiles for h5import -./tools/test/h5import/testfiles/binfp64.conf ./tools/test/h5import/testfiles/binfp64.h5 -./tools/test/h5import/testfiles/binin16.conf ./tools/test/h5import/testfiles/binin16.h5 -./tools/test/h5import/testfiles/binin32.conf ./tools/test/h5import/testfiles/binin32.h5 -./tools/test/h5import/testfiles/binin8.conf ./tools/test/h5import/testfiles/binin8.h5 -./tools/test/h5import/testfiles/binin8w.conf ./tools/test/h5import/testfiles/binin8w.h5 -./tools/test/h5import/testfiles/binuin16.conf ./tools/test/h5import/testfiles/binuin16.h5 -./tools/test/h5import/testfiles/binuin32.conf ./tools/test/h5import/testfiles/binuin32.h5 ./tools/test/h5import/testfiles/tall_fp32.ddl ./tools/test/h5import/testfiles/tall_i32.ddl +./tools/test/h5import/testfiles/tintsattrs_u32.ddl ./tools/test/h5import/testfiles/textpfe.conf ./tools/test/h5import/testfiles/textpfe.h5 ./tools/test/h5import/testfiles/textpfe64.txt diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index 9a61beb..eea0a17 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -13,7 +13,7 @@ add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import STATIC) TARGET_C_PROPERTIES (h5import STATIC " " " ") target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) +set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) set_target_properties (h5import PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import") diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 0f7be3d..c489e09 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -41,6 +41,7 @@ static int parseDimensions(struct Input *in, char *strm); static int getInputSize(struct Input *in, int ival); static int getInputClass(struct Input *in, char * strm); static int getInputClassType(struct Input *in, char * strm); +static int getInputByteOrder(struct Input *in, FILE *strm); static int InputClassStrToInt(char *temp); static int getRank(struct Input *in, FILE *strm); static int getDimensionSizes(struct Input *in, FILE *strm); @@ -497,7 +498,7 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } -#ifdef H5DEBUGIMPORT2 +#ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in08, *in08); #endif } @@ -528,11 +529,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *in16 = temp16; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in16 = swap_int16(temp16); -#ifdef H5DEBUGIMPORT2 + else + *in16 = temp16; +#ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in16, temp16); #endif } @@ -562,10 +563,10 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *in32 = temp32; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in32 = swap_int32(temp32); + else + *in32 = temp32; #ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); #endif @@ -598,11 +599,11 @@ static int readIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *in64 = temp64; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in64 = swap_int64(temp64); -#ifdef H5DEBUGIMPORT2 + else + *in64 = temp64; +#ifdef H5DEBUGIMPORT printf("readIntegerData %d (0x%.8X)\n", *in64, temp64); #endif } @@ -692,10 +693,13 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *in16 = temp16; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in16 = swap_uint16(temp16); + else + *in16 = temp16; +#ifdef H5DEBUGIMPORT + printf("readUIntegerData %d (0x%.4X = 0x%.4X)\n", *in16, *in16, temp16); +#endif } break; @@ -723,10 +727,13 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *in32 = temp32; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in32 = swap_uint32(temp32); + else + *in32 = temp32; +#ifdef H5DEBUGIMPORT + printf("readUIntegerData %d (0x%.8X = 0x%.8X)\n", *in32, *in32, temp32); +#endif } break; @@ -756,10 +763,13 @@ static int readUIntegerData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *in64 = temp64; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *in64 = swap_uint64(temp64); + else + *in64 = temp64; +#ifdef H5DEBUGIMPORT + printf("readUIntegerData %ld (0x%.8X = 0x%.8X)\n", *in64, *in64, temp64); +#endif } break; @@ -831,12 +841,12 @@ static int readFloatData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *bfp32 = temp32; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *bfp32 = swap_uint32(temp32); + else + *bfp32 = temp32; #ifdef H5DEBUGIMPORT - printf("readFloatData %f (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); + printf("readFloatData %ld (0x%.8X = 0x%.8X)\n", *bfp32, *bfp32, temp32); #endif } break; @@ -881,12 +891,12 @@ static int readFloatData(FILE *strm, struct Input *in) (void) HDfprintf(stderr, "%s", err1); return (-1); } - if (in->outputByteOrder) - *bfp64 = temp64; - else + if (in-> h5dumpInput && (in->inputByteOrder != in->outputByteOrder)) *bfp64 = swap_uint64(temp64); -#ifdef H5DEBUGIMPORT2 - printf("readFloatData %lf (0x%.8X)\n", fp64, temp64); + else + *bfp64 = temp64; +#ifdef H5DEBUGIMPORT + printf("readFloatData %ld (0x%.16lX)\n", *bfp64, temp64); #endif } break; @@ -1353,7 +1363,7 @@ static int processConfigurationFile(char *infile, struct Input *in) int retval = -1; const char *err1 = "Unable to open the configuration file: %s for reading.\n"; - const char *err2 = "Unknown keyword in configuration file: %s\n"; + const char *err2 = "Unknown keyword: %s in configuration file: %s\n"; const char *err3a = "PATH keyword appears twice in %s.\n"; const char *err3b = "Error in parsing the path information from %s.\n"; const char *err4a = "INPUT-CLASS keyword appears twice in %s.\n"; @@ -1373,6 +1383,9 @@ static int processConfigurationFile(char *infile, struct Input *in) const char *err10b = "Error in retrieving the output architecture from %s.\n"; const char *err11a = "OUTPUT-BYTE-ORDER keyword appears twice in %s.\n"; const char *err11b = "Error in retrieving the output byte order from %s.\n"; + const char *err11c = "INPUT-BYTE-ORDER keyword appears twice in %s.\n"; + const char *err11d = "Error in retrieving the input byte order from %s.\n"; + const char *err11e = "Invalid value for output byte-order.\n"; const char *err12a = "CHUNKED-DIMENSION-SIZES keyword appears twice in %s.\n"; const char *err12b = "CHUNKED-DIMENSION-SIZES cannot appear before DIMENSION-SIZES are provided.\n"; const char *err12c = "Error in retrieving the chunked dimension sizes from %s.\n"; @@ -1396,6 +1409,26 @@ static int processConfigurationFile(char *infile, struct Input *in) process the output file according to the options */ + /* Initialize machine endian */ + volatile uint32_t ibyte=0x01234567; + /* 0 for big endian, 1 for little endian. */ + if ((*((uint8_t*)(&ibyte))) == 0x67) { + if ((kindex = OutputByteOrderStrToInt("LE")) == -1) { + (void) HDfprintf(stderr, "%s", err11e); + return (-1); + } + } + else { + if ((kindex = OutputByteOrderStrToInt("BE")) == -1) { + (void) HDfprintf(stderr, "%s", err11e); + return (-1); + } + } + in->inputByteOrder = kindex; +#ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); +#endif + if ((strm = HDfopen(infile, "r")) == NULL) { (void) HDfprintf(stderr, err1, infile); goto error; @@ -1631,15 +1664,15 @@ static int processConfigurationFile(char *infile, struct Input *in) goto error; } #ifdef H5DEBUGIMPORT - printf("h5dump DATASPACE SIMPLE %d rank\n", in->rank); + printf("h5dump DATASPACE SIMPLE %ld rank\n", in->rank); #endif for (i = 0; i < in->rank; i++) { in->sizeOfDimension[i] = temp_dims[i]; } #ifdef H5DEBUGIMPORT - printf("h5dump DATASPACE SIMPLE dims:", in->rank); + printf("h5dump DATASPACE SIMPLE dims[%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } printf("\n"); #endif @@ -1712,9 +1745,9 @@ static int processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_dim) */ #ifdef H5DEBUGIMPORT - printf("h5dump DATASPACE SIMPLE maxdims:", in->rank); + printf("h5dump DATASPACE SIMPLE maxdims[%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->maxsizeOfDimension[pndx]); + printf(" %ld", in->maxsizeOfDimension[pndx]); } printf("\n"); printf("h5dump DATASPACE SIMPLE get max dim finished\n"); @@ -1799,9 +1832,9 @@ static int processConfigurationFile(char *infile, struct Input *in) } } /* while (get_next_dim) */ #ifdef H5DEBUGIMPORT - printf("h5dump STORAGE_LAYOUT CHUNKED dims:", in->rank); + printf("h5dump STORAGE_LAYOUT CHUNKED dims [%ld]:", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->sizeOfChunk[pndx]); + printf(" %ld", in->sizeOfChunk[pndx]); } printf("\n"); #endif @@ -1927,7 +1960,7 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("h5dump SUBSET key\n"); #endif if (fscanf(strm, "%s", temp) != 1) { /* start bracket */ - (void) HDfprintf(stderr, err6b, infile); + (void) HDfprintf(stderr, err20, infile); goto error; } #ifdef H5DEBUGIMPORT @@ -1990,7 +2023,7 @@ static int processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT printf("h5dump SUBSET COUNT dims: [%d]", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } printf("\n"); #endif @@ -2046,7 +2079,7 @@ static int processConfigurationFile(char *infile, struct Input *in) #ifdef H5DEBUGIMPORT printf("h5dump SUBSET BLOCK dims: [%d]", in->rank); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d", in->sizeOfDimension[pndx]); + printf(" %ld", in->sizeOfDimension[pndx]); } printf("\n"); #endif @@ -2082,6 +2115,7 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("\n"); printf("h5dump inputClass=%d\n", in->inputClass); printf("h5dump inputSize=%d\n", in->inputSize); + printf("h5dump inputByteOrder=%d\n", in->inputByteOrder); printf("h5dump rank=%d\n", in->rank); printf("h5dump outputClass=%d\n", in->outputClass); printf("h5dump outputSize=%d\n", in->outputSize); @@ -2092,7 +2126,7 @@ static int processConfigurationFile(char *infile, struct Input *in) printf("h5dump externFilename=%s\n", in->externFilename); printf("h5dump sizeOfDimensions:\n"); for (pndx = 0; pndx < in->rank; pndx++) { - printf(" %d\n", in->sizeOfDimension[pndx]); + printf(" %ld\n", in->sizeOfDimension[pndx]); } #endif } @@ -2102,7 +2136,7 @@ static int processConfigurationFile(char *infile, struct Input *in) #endif while (scanret == 1) { if ((kindex = mapKeywordToIndex(key)) == -1) { - (void) HDfprintf(stderr, err2, infile); + (void) HDfprintf(stderr, err2, key, infile); goto error; } switch (kindex) { @@ -2337,6 +2371,19 @@ static int processConfigurationFile(char *infile, struct Input *in) in->configOptionVector[EXTEND] = 1; break; + case 14: /* INPUT-BYTE-ORDER */ + if (in->configOptionVector[INPUT_B_ORDER] == 1) { + (void) HDfprintf(stderr, err11c, infile); + goto error; + } + + if (getInputByteOrder(in, strm) == -1) { + (void) HDfprintf(stderr, err11d, infile); + goto error; + } + in->configOptionVector[INPUT_B_ORDER] = 1; + break; + default: break; } @@ -2577,7 +2624,7 @@ static int getInputClassType(struct Input *in, char * buffer) int kindex = -1; const char *err1 = "Invalid value for input class.\n"; const char *err2 = "Invalid value for output architecture.\n"; - const char *err3 = "Invalid value for output byte-order.\n"; + const char *err3 = "Invalid value for input byte-order.\n"; if (!HDstrcmp(buffer, "H5T_STD_I8BE")) { in->inputSize = 8; @@ -2594,6 +2641,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2612,6 +2663,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2630,6 +2685,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2648,6 +2707,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2666,6 +2729,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2684,6 +2751,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2702,6 +2773,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2720,6 +2795,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 4; } @@ -2738,6 +2817,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2756,6 +2839,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2774,6 +2861,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2792,6 +2883,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2810,6 +2905,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2828,6 +2927,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2846,6 +2949,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -2864,6 +2971,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 7; } @@ -3002,6 +3113,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -3020,6 +3135,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -3038,6 +3157,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -3056,6 +3179,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = 3; } @@ -3129,6 +3256,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3145,6 +3276,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3161,6 +3296,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3177,6 +3316,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3193,6 +3336,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3209,6 +3356,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3225,6 +3376,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3241,6 +3396,10 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; +// in->inputByteOrder = kindex; + #ifdef H5DEBUGIMPORT + printf("h5dump inputByteOrder %d\n", in->inputByteOrder); + #endif kindex = -1; } @@ -3313,6 +3472,27 @@ static int getInputSize(struct Input *in, int ival) return (-1); } +static int getInputByteOrder(struct Input *in, FILE *strm) +{ + char temp[255]; + int kindex; + const char *err1 = "Unable to get 'string' value.\n"; + const char *err2 = "Invalid value for input byte-order.\n"; + + if (fscanf(strm, "%s", temp) != 1) { + (void) HDfprintf(stderr, "%s", err1); + return (-1); + } + + if ((kindex = OutputByteOrderStrToInt(temp)) == -1) { + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + + in->inputByteOrder = kindex; + return (0); +} + static int getRank(struct Input *in, FILE *strm) { int ival; @@ -3578,6 +3758,7 @@ void setDefaultValues(struct Input *in, int count) in->inputSize = 32; in->outputClass = 1; /* FP */ in->outputSize = 32; + in->inputByteOrder = -1; /* use default */ in->rank = 0; in->path.count = 1; @@ -3950,85 +4131,433 @@ hid_t createInputDataType(struct Input *in) { hid_t new_type = (-1); const char *err1 = "Invalid value for input class.\n"; - const char *err2 = "Invalid value for output size.\n"; + const char *err2 = "Invalid value for input size.\n"; + const char *err3 = "Invalid value for input byte order.\n"; + const char *err4 = "Invalid value for output architecture.\n"; + const char *err5 = "STD not supported for float.\n"; + const char *err6 = "IEEE not supported for INT.\n"; - switch (in->inputClass) { - case 0: - case 4: - switch (in->inputSize) { - case 8: - new_type = H5Tcopy(H5T_NATIVE_CHAR); - break; + if (in->h5dumpInput) { + switch (in->inputClass) { + case 4: + switch (in->outputArchitecture) { + case 0: /* NATIVE */ + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_CHAR); + break; - case 16: - new_type = H5Tcopy(H5T_NATIVE_SHORT); - break; + case 16: + new_type = H5Tcopy(H5T_NATIVE_SHORT); + break; - case 32: - new_type = H5Tcopy(H5T_NATIVE_INT); - break; + case 32: + new_type = H5Tcopy(H5T_NATIVE_INT); + break; - case 64: - new_type = H5Tcopy(H5T_NATIVE_LLONG); + case 64: + new_type = H5Tcopy(H5T_NATIVE_LLONG); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + switch (in->inputByteOrder) { + case -1: /* default */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); + break; + + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 1: /* STD */ + switch (in->inputSize) { + case 8: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I8BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I8LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 16: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I16BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I16LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 32: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I32LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 64: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_I64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_I64LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); + } break; - default: - (void) HDfprintf(stderr, "%s", err2); - return (-1); - } - break; + case 3: + switch (in->outputArchitecture) { + case 0: + switch (in->inputSize) { + case 32: + new_type = H5Tcopy(H5T_NATIVE_FLOAT); + break; - case 1: - case 2: - case 3: - switch (in->inputSize) { - case 32: - new_type = H5Tcopy(H5T_NATIVE_FLOAT); + case 64: + new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + switch (in->inputByteOrder) { + case -1: /* DEFAULT */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); + break; + + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 1: + (void) HDfprintf(stderr, "%s", err5); + return (-1); + + case 2: + switch (in->inputSize) { + case 32: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_IEEE_F32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_IEEE_F32LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 64: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_IEEE_F64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_IEEE_F64LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); + } break; - case 64: - new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + case 7: + switch (in->outputArchitecture) { + case 0: + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_UCHAR); + break; + + case 16: + new_type = H5Tcopy(H5T_NATIVE_USHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_UINT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_ULLONG); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + switch (in->inputByteOrder) { + case -1: /* Default */ + break; + case 0: + H5Tset_order(new_type, H5T_ORDER_BE); + break; + + case 1: + H5Tset_order(new_type, H5T_ORDER_LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 1: + switch (in->inputSize) { + case 8: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U8BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U8LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 16: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U16BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U16LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 32: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U32BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U32LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + case 64: + switch (in->inputByteOrder) { + case -1: + case 0: + new_type = H5Tcopy(H5T_STD_U64BE); + break; + + case 1: + new_type = H5Tcopy(H5T_STD_U64LE); + break; + + default: + (void) HDfprintf(stderr, "%s", err3); + return (-1); + } + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } + break; + + case 2: + (void) HDfprintf(stderr, "%s", err6); + return (-1); + + default: + (void) HDfprintf(stderr, "%s", err4); + return (-1); + } break; default: - (void) HDfprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err1); return (-1); } - break; + } + else { + switch (in->inputClass) { + case 0: + case 4: + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_CHAR); + break; - case 5: - (void) HDfprintf(stderr, "%s", err1); - return (-1); - break; + case 16: + new_type = H5Tcopy(H5T_NATIVE_SHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_INT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_LLONG); + break; - case 6: - case 7: - switch (in->inputSize) { - case 8: - new_type = H5Tcopy(H5T_NATIVE_UCHAR); + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } break; - case 16: - new_type = H5Tcopy(H5T_NATIVE_USHORT); + case 1: + case 2: + case 3: + switch (in->inputSize) { + case 32: + new_type = H5Tcopy(H5T_NATIVE_FLOAT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_DOUBLE); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } break; - case 32: - new_type = H5Tcopy(H5T_NATIVE_UINT); + case 5: + (void) HDfprintf(stderr, "%s", err1); + return (-1); break; - case 64: - new_type = H5Tcopy(H5T_NATIVE_ULLONG); + case 6: + case 7: + switch (in->inputSize) { + case 8: + new_type = H5Tcopy(H5T_NATIVE_UCHAR); + break; + + case 16: + new_type = H5Tcopy(H5T_NATIVE_USHORT); + break; + + case 32: + new_type = H5Tcopy(H5T_NATIVE_UINT); + break; + + case 64: + new_type = H5Tcopy(H5T_NATIVE_ULLONG); + break; + + default: + (void) HDfprintf(stderr, "%s", err2); + return (-1); + } break; default: - (void) HDfprintf(stderr, "%s", err2); + (void) HDfprintf(stderr, "%s", err1); return (-1); } - break; - - default: - (void) HDfprintf(stderr, "%s", err1); - return (-1); } return new_type; } @@ -4117,7 +4646,7 @@ static int process(struct Options *opt) intype = createInputDataType(in); outtype = createOutputDataType(in); #ifdef H5DEBUGIMPORT - printf("process intype %d outtype %d\n", intype, outtype); + printf("process intype %ld outtype %ld\n", intype, outtype); #endif /* create property list */ @@ -4416,6 +4945,7 @@ void help(char *name) (void) HDfprintf(stdout, "\t PATH\n"); (void) HDfprintf(stdout, "\t INPUT-CLASS\n"); (void) HDfprintf(stdout, "\t INPUT-SIZE\n"); + (void) HDfprintf(stdout, "\t INPUT-BYTE-ORDER\n"); (void) HDfprintf(stdout, "\t RANK\n"); (void) HDfprintf(stdout, "\t DIMENSION-SIZES\n"); (void) HDfprintf(stdout, "\t OUTPUT-CLASS\n"); diff --git a/tools/src/h5import/h5import.h b/tools/src/h5import/h5import.h index c69a542..b27b944 100644 --- a/tools/src/h5import/h5import.h +++ b/tools/src/h5import/h5import.h @@ -37,7 +37,7 @@ #define MAX_GROUPS_IN_PATH 20 #define MAX_PATH_NAME_LENGTH 255 -#define NUM_KEYS 14 +#define NUM_KEYS 15 #define MIN_NUM_DIMENSION 1 #define MAX_NUM_DIMENSION 32 #define BASE_10 10 @@ -56,6 +56,7 @@ #define COMPRESS_PARAM 11 #define EXTERNALSTORE 12 #define EXTEND 13 +#define INPUT_B_ORDER 14 /* data types */ #define H5DT_INT8 signed char @@ -82,6 +83,7 @@ struct Input struct path_info path; int inputClass; int inputSize; + int inputByteOrder; int rank; hsize_t* sizeOfDimension; int outputClass; @@ -126,7 +128,8 @@ char keytable[NUM_KEYS][30] = { "COMPRESSION-TYPE", "COMPRESSION-PARAM", "EXTERNAL-STORAGE", - "MAXIMUM-DIMENSIONS" + "MAXIMUM-DIMENSIONS", + "INPUT-BYTE-ORDER" }; static int state_table[15][8] = diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 89685fa..009434f 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -17,13 +17,6 @@ ############################################################################## set (HDF5_REFERENCE_CONF_FILES - binfp64.conf - binin8.conf - binin8w.conf - binin16.conf - binin32.conf - binuin16.conf - binuin32.conf txtfp32.conf txtfp64.conf txtin8.conf @@ -75,6 +68,7 @@ ) set (HDF5_TOOLS_TEST_FILES tall.h5 + tintsattrs.h5 ) file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") @@ -176,7 +170,7 @@ NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;FILE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" -D "TEST_EXPECT=0" @@ -489,12 +483,19 @@ COMMAND ${CMAKE_COMMAND} -E remove binfp64.bin + binfp64.conf binin8.bin + binin8.conf binin8w.bin + binin8w.conf binin16.bin + binin16.conf binin32.bin + binin32.conf binuin16.bin + binuin16.conf binuin32.bin + binuin32.conf ) if (NOT "${last_test}" STREQUAL "") set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -526,7 +527,7 @@ ADD_H5_TEST (ASCII_F64 testfiles/txtfp64.txt testfiles/txtfp64.conf txtfp64.h5) # ----- TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " - ADD_H5_TEST (BINARY_F64 binfp64.bin testfiles/binfp64.conf binfp64.h5) + ADD_H5_TEST (BINARY_F64 binfp64.bin binfp64.conf binfp64.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_F64 "/fp/bin/64-bit" binfp64.h5 BINARY) else () @@ -534,7 +535,7 @@ endif () # ----- TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " - ADD_H5_TEST (BINARY_I8 binin8.bin testfiles/binin8.conf binin8.h5) + ADD_H5_TEST (BINARY_I8 binin8.bin binin8.conf binin8.h5) if (NOT USE_FILTER_DEFLATE) ADD_H5_SKIP_DUMPTEST (BINARY_I8 "/int/bin/8-bit" binin8.h5 BINARY) else () @@ -542,19 +543,19 @@ endif () # ----- TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " - ADD_H5_TEST (BINARY_I16 binin16.bin testfiles/binin16.conf binin16.h5) + ADD_H5_TEST (BINARY_I16 binin16.bin binin16.conf binin16.h5) ADD_H5_DUMPTEST (BINARY_I16 "/int/bin/16-bit" binin16.h5 BINARY) # ----- TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " - ADD_H5_TEST (BINARY_I32 binin32.bin testfiles/binin32.conf binin32.h5) + ADD_H5_TEST (BINARY_I32 binin32.bin binin32.conf binin32.h5) ADD_H5_DUMPTEST (BINARY_I32 "/int/bin/32-bit" binin32.h5 BINARY) # ----- TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " - ADD_H5_TEST (BINARY_UI16 binuin16.bin testfiles/binuin16.conf binuin16.h5) + ADD_H5_TEST (BINARY_UI16 binuin16.bin binuin16.conf binuin16.h5) ADD_H5_DUMPTEST (BINARY_UI16 "/int/buin/16-bit" binuin16.h5 BINARY) # ----- TESTING "BINARY UI32 - rank 3 - Output LE " - ADD_H5_TEST (BINARY_UI32 binuin32.bin testfiles/binuin32.conf binuin32.h5) + ADD_H5_TEST (BINARY_UI32 binuin32.bin binuin32.conf binuin32.h5) ADD_H5_DUMPTEST (BINARY_UI32 "/int/buin/32-bit" binuin32.h5 BINARY) # ----- TESTING "STR" @@ -562,7 +563,7 @@ ADD_H5_DUMPTEST (STR "/mytext/data" txtstr.h5) # ----- TESTING "BINARY I8 CR LF EOF" - ADD_H5_TEST (BINARY_I8_EOF binin8w.bin testfiles/binin8w.conf binin8w.h5) + ADD_H5_TEST (BINARY_I8_EOF binin8w.bin binin8w.conf binin8w.h5) ADD_H5_DUMPTEST (BINARY_I8_EOF "/dataset0" binin8w.h5 BINARY) # ----- TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " @@ -571,4 +572,5 @@ # ----- TESTING "Binary Subset " ADD_H5_DUMPSUBTEST (tall_fp32 tall.h5 /g2/dset2.2 --start=1,1 --stride=2,3 --count=1,2 --block=1,1) ADD_H5_DUMPSUBTEST (tall_i32 tall.h5 /g1/g1.1/dset1.1.1 --start=1,1 --stride=2,3 --count=3,2 --block=1,1) + ADD_H5_DUMPSUBTEST (tintsattrs_u32 tintsattrs.h5 /DU32BITS --start=1,1 --stride=2,3 --count=3,2 --block=1,1) diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index 135b8e4..00ae2e7 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -25,7 +25,7 @@ * h5importtest * * Description: - * This program creates that can be + * This program creates files that can be * used to test the h5import program. * */ @@ -36,6 +36,7 @@ main(void) int nrow = 3, ncol = 4, npln = 5; int i, j, k; FILE *sp; + char machine_order[3] = {0, 0, 0}; float row4[3], col4[4], pln4[5]; float rowo4 = 11.0F, colo4 = 21.0F, plno4 = 51.0F; @@ -67,6 +68,14 @@ main(void) double rowo8 = 11.0F, colo8 = 21.0F, plno8 = 51.0F; double rowi8 = 1.0F, coli8 = 2.0F, plni8 = 5.0F; + /* Initialize machine endian */ + volatile uint32_t ibyte=0x01234567; + /* 0 for big endian, 1 for little endian. */ + if ((*((uint8_t*)(&ibyte))) == 0x67) + strncpy(machine_order, "LE", 2); + else + strncpy(machine_order, "BE", 2); + /* * initialize the row, column, and plane vectors @@ -217,7 +226,7 @@ main(void) #endif /*------------------------------------------------------------------------- - * TOOLTEST binin32.bin -c $srcdir/testfiles/binin32.conf -o binin32.h5 + * TOOLTEST binin32.bin -c binin32.conf -o binin32.h5 *------------------------------------------------------------------------- */ @@ -234,8 +243,21 @@ main(void) } (void) HDfclose(sp); + sp = HDfopen("binin32.conf", "w"); + (void) fprintf(sp, "PATH /int/bin/32-bit\n"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 32\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); + /*------------------------------------------------------------------------- - * TOOLTEST binuin32.bin -c $srcdir/testfiles/binuin32.conf -o binuin32.h5 + * TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5 *------------------------------------------------------------------------- */ @@ -252,11 +274,20 @@ main(void) } (void) HDfclose(sp); - - + sp = HDfopen("binuin32.conf", "w"); + (void) fprintf(sp, "PATH /int/buin/32-bit\n"); + (void) fprintf(sp, "INPUT-CLASS UIN\n"); + (void) fprintf(sp, "INPUT-SIZE 32\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); /*------------------------------------------------------------------------- - * TOOLTEST binin16.bin -c $srcdir/testfiles/binin16.conf -o binin16.h5 + * TOOLTEST binin16.bin -c binin16.conf -o binin16.h5 *------------------------------------------------------------------------- */ @@ -273,8 +304,22 @@ main(void) } (void) HDfclose(sp); + sp = HDfopen("binin16.conf", "w"); + (void) fprintf(sp, "PATH /int/bin/16-bit\n"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 16\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); + /*------------------------------------------------------------------------- - * TOOLTEST binuin16.bin -c $srcdir/testfiles/binuin16.conf -o binuin16.h5 + * TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 *------------------------------------------------------------------------- */ sp = HDfopen("binuin16.bin", OPEN_FLAGS); @@ -290,10 +335,22 @@ main(void) } (void) HDfclose(sp); - + sp = HDfopen("binuin16.conf", "w"); + (void) fprintf(sp, "PATH /int/buin/16-bit\n"); + (void) fprintf(sp, "INPUT-CLASS UIN\n"); + (void) fprintf(sp, "INPUT-SIZE 16\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); /*------------------------------------------------------------------------- - * TOOLTEST binin8.bin -c $srcdir/testfiles/binin8.conf -o binin8.h5 + * TOOLTEST binin8.bin -c binin8.conf -o binin8.h5 *------------------------------------------------------------------------- */ @@ -310,13 +367,27 @@ main(void) } (void) HDfclose(sp); -#endif /* UNICOS */ - - + sp = HDfopen("binin8.conf", "w"); + (void) fprintf(sp, "PATH /int/bin/8-bit\n"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 8\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-CLASS IN\n"); + (void) fprintf(sp, "OUTPUT-SIZE 16\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); + (void) fprintf(sp, "COMPRESSION-PARAM 3\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); +#endif /* UNICOS */ /*------------------------------------------------------------------------- - * TOOLTEST binfp64.bin -c $srcdir/testfiles/binfp64.conf -o binfp64.h5 + * TOOLTEST binfp64.bin -c binfp64.conf -o binfp64.h5 *------------------------------------------------------------------------- */ @@ -337,10 +408,23 @@ main(void) } (void) HDfclose(sp); - + sp = HDfopen("binfp64.conf", "w"); + (void) fprintf(sp, "PATH /fp/bin/64-bit\n"); + (void) fprintf(sp, "INPUT-CLASS FP\n"); + (void) fprintf(sp, "INPUT-SIZE 64\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 3\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); + (void) fprintf(sp, "COMPRESSION-PARAM 8\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); /*------------------------------------------------------------------------- - * TOOLTEST binin8w.bin -c $srcdir/testfiles/binin8w.conf -o binin8w.h5 + * TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5 *------------------------------------------------------------------------- */ @@ -357,13 +441,20 @@ main(void) } HDfclose(sp); + sp = HDfopen("binin8w.conf", "w"); + (void) fprintf(sp, "INPUT-CLASS IN\n"); + (void) fprintf(sp, "INPUT-SIZE 8\n"); + (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) fprintf(sp, "RANK 1\n"); + (void) fprintf(sp, "OUTPUT-CLASS IN\n"); + (void) fprintf(sp, "OUTPUT-SIZE 8\n"); + (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) fprintf(sp, "DIMENSION-SIZES 4\n"); + (void) fprintf(sp, "\n"); + (void) HDfclose(sp); } - - - - - return (EXIT_SUCCESS); } diff --git a/tools/test/h5import/testfiles/binfp64.conf b/tools/test/h5import/testfiles/binfp64.conf deleted file mode 100644 index 6b4c361..0000000 --- a/tools/test/h5import/testfiles/binfp64.conf +++ /dev/null @@ -1,13 +0,0 @@ -PATH /fp/bin/64-bit -INPUT-CLASS FP -INPUT-SIZE 64 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE IEEE -OUTPUT-BYTE-ORDER LE -CHUNKED-DIMENSION-SIZES 2 2 2 -COMPRESSION-PARAM 8 -MAXIMUM-DIMENSIONS -1 6 7 - - - diff --git a/tools/test/h5import/testfiles/binin16.conf b/tools/test/h5import/testfiles/binin16.conf deleted file mode 100644 index 06869cb..0000000 --- a/tools/test/h5import/testfiles/binin16.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/bin/16-bit -INPUT-CLASS IN -INPUT-SIZE 16 -RANK 3 -DIMENSION-SIZES 2 3 4 -CHUNKED-DIMENSION-SIZES 2 2 2 -MAXIMUM-DIMENSIONS -1 -1 8 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER LE - - - diff --git a/tools/test/h5import/testfiles/binin32.conf b/tools/test/h5import/testfiles/binin32.conf deleted file mode 100644 index 11996ef..0000000 --- a/tools/test/h5import/testfiles/binin32.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/bin/32-bit -INPUT-CLASS IN -INPUT-SIZE 32 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER BE -CHUNKED-DIMENSION-SIZES 1 2 1 - - - - diff --git a/tools/test/h5import/testfiles/binin32.h5 b/tools/test/h5import/testfiles/binin32.h5 index fd8faa9..2ec5b7c 100644 Binary files a/tools/test/h5import/testfiles/binin32.h5 and b/tools/test/h5import/testfiles/binin32.h5 differ diff --git a/tools/test/h5import/testfiles/binin8.conf b/tools/test/h5import/testfiles/binin8.conf deleted file mode 100644 index 1edd80a..0000000 --- a/tools/test/h5import/testfiles/binin8.conf +++ /dev/null @@ -1,16 +0,0 @@ -PATH /int/bin/8-bit -INPUT-CLASS IN -INPUT-SIZE 8 -OUTPUT-CLASS IN -OUTPUT-SIZE 16 -RANK 3 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER LE -DIMENSION-SIZES 5 3 4 -CHUNKED-DIMENSION-SIZES 2 2 2 -MAXIMUM-DIMENSIONS -1 -1 -1 -COMPRESSION-PARAM 3 - - - - diff --git a/tools/test/h5import/testfiles/binin8w.conf b/tools/test/h5import/testfiles/binin8w.conf deleted file mode 100644 index fccb4ac..0000000 --- a/tools/test/h5import/testfiles/binin8w.conf +++ /dev/null @@ -1,9 +0,0 @@ - -INPUT-CLASS IN -INPUT-SIZE 8 -RANK 1 -DIMENSION-SIZES 4 -OUTPUT-BYTE-ORDER LE -OUTPUT-CLASS IN -OUTPUT-SIZE 8 -OUTPUT-ARCHITECTURE STD diff --git a/tools/test/h5import/testfiles/binuin16.conf b/tools/test/h5import/testfiles/binuin16.conf deleted file mode 100644 index a4603df..0000000 --- a/tools/test/h5import/testfiles/binuin16.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/buin/16-bit -INPUT-CLASS UIN -INPUT-SIZE 16 -RANK 3 -DIMENSION-SIZES 2 3 4 -CHUNKED-DIMENSION-SIZES 2 2 2 -MAXIMUM-DIMENSIONS -1 -1 8 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER BE - - - diff --git a/tools/test/h5import/testfiles/binuin32.conf b/tools/test/h5import/testfiles/binuin32.conf deleted file mode 100644 index a649e97..0000000 --- a/tools/test/h5import/testfiles/binuin32.conf +++ /dev/null @@ -1,12 +0,0 @@ -PATH /int/buin/32-bit -INPUT-CLASS UIN -INPUT-SIZE 32 -RANK 3 -DIMENSION-SIZES 5 3 4 -OUTPUT-ARCHITECTURE STD -OUTPUT-BYTE-ORDER LE - - - - - diff --git a/tools/test/h5import/testfiles/tintsattrs_u32.ddl b/tools/test/h5import/testfiles/tintsattrs_u32.ddl new file mode 100644 index 0000000..cf8889c --- /dev/null +++ b/tools/test/h5import/testfiles/tintsattrs_u32.ddl @@ -0,0 +1,28 @@ +HDF5 "d-tintsattrs_u32.h5" { +GROUP "/" { + DATASET "DU32BITS" { + DATATYPE H5T_STD_U32LE + DATASPACE SIMPLE { ( 3, 2 ) / ( 3, 2 ) } + STORAGE_LAYOUT { + CONTIGUOUS + SIZE 24 + OFFSET 2048 + } + FILTERS { + NONE + } + FILLVALUE { + FILL_TIME H5D_FILL_TIME_IFSET + VALUE H5D_FILL_VALUE_DEFAULT + } + ALLOCATION_TIME { + H5D_ALLOC_TIME_LATE + } + DATA { + (0,0): 4294967292, 4294967264, + (1,0): 4294967280, 4294967168, + (2,0): 4294967232, 4294966784 + } + } +} +} -- cgit v0.12 From 7424ea56d7597b88c05136f1fa978b496a232549 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 12:27:03 -0500 Subject: HDFFV-10219 Add new reference file file for new test --- tools/test/h5import/CMakeTests.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 009434f..aaf9052 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -47,6 +47,7 @@ dtxtstr.h5.txt tall_fp32.ddl tall_i32.ddl + tintsattrs_u32.ddl ) set (HDF5_REFERENCE_TEST_FILES binfp64.h5 -- cgit v0.12 From 811bb5eeda1b0c4f07611f295545fa764c48e454 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 12:29:34 -0500 Subject: HDFFV-10219 - disable debug output --- tools/src/h5import/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/src/h5import/CMakeLists.txt b/tools/src/h5import/CMakeLists.txt index eea0a17..9a61beb 100644 --- a/tools/src/h5import/CMakeLists.txt +++ b/tools/src/h5import/CMakeLists.txt @@ -13,7 +13,7 @@ add_executable (h5import ${HDF5_TOOLS_SRC_H5IMPORT_SOURCE_DIR}/h5import.c) TARGET_NAMING (h5import STATIC) TARGET_C_PROPERTIES (h5import STATIC " " " ") target_link_libraries (h5import ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) -set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) +#set_target_properties (h5import PROPERTIES COMPILE_DEFINITIONS H5DEBUGIMPORT) set_target_properties (h5import PROPERTIES FOLDER tools) set_global_variable (HDF5_UTILS_TO_EXPORT "${HDF5_UTILS_TO_EXPORT};h5import") -- cgit v0.12 From c82ec4d734a1d7c3a684f823db78eaf4c1d21c6c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 12:37:07 -0500 Subject: Update release note --- release_docs/RELEASE.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index 35cf372..20d58b3 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -123,8 +123,11 @@ Bug Fixes since HDF5-1.10.1 release Improved h5import by adding the SUBSET keyword. h5import understands to use the Count times the Block as the size of the dimensions. + Added INPUT_B_ORDER keyword to old-style configuration files. + The import from h5dump function expects the binary files to use native + types (FILE '-b' option) in the binary file. - (ADB - 2017/06/12, HDFFV-102191) + (ADB - 2017/06/15, HDFFV-102191) - h5repack -- cgit v0.12 From 1210d58b878b3d2133d65d849edbc174b4f2c98b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 12:51:56 -0500 Subject: Fix changes to reference files. Still need to add subset test. --- tools/test/h5import/h5importtestutil.sh.in | 84 +++++++++++++++++------------- 1 file changed, 49 insertions(+), 35 deletions(-) diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index 3bbe37b..2f8c837 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -86,13 +86,6 @@ $SRC_H5IMPORT_TESTFILES/textpfe.h5 " LIST_OTHER_TEST_FILES=" -$SRC_H5IMPORT_TESTFILES/binfp64.conf -$SRC_H5IMPORT_TESTFILES/binin8.conf -$SRC_H5IMPORT_TESTFILES/binin8w.conf -$SRC_H5IMPORT_TESTFILES/binin16.conf -$SRC_H5IMPORT_TESTFILES/binin32.conf -$SRC_H5IMPORT_TESTFILES/binuin16.conf -$SRC_H5IMPORT_TESTFILES/binuin32.conf $SRC_H5IMPORT_TESTFILES/txtfp32.conf $SRC_H5IMPORT_TESTFILES/txtfp64.conf $SRC_H5IMPORT_TESTFILES/txtin8.conf @@ -142,10 +135,10 @@ COPY_TESTFILES_TO_TESTDIR() INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'` INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'` if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then - $CP -f $tstfile $TESTDIR + $CP -f $tstfile $TESTDIR if [ $? -ne 0 ]; then echo "Error: FAILED to copy $tstfile ." - + # Comment out this to CREATE expected file exit $EXIT_FAILURE fi @@ -206,7 +199,7 @@ fi TOOLTEST2() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b FILE tmp_testfiles/$2 > d$2.dmp $RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp $RUNSERIAL $H5DIFF_BIN -v d$2 tmp_testfiles/$2 $1 $1 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 @@ -264,7 +257,28 @@ else fi } -echo "" +# Same as TOOLTEST2 except for subsets +# Use h5dump output as input to h5import for binary numbers +# Use h5dump to verify results +TOOLTEST5() +{ +err=0 +$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b FILE tmp_testfiles/$2 > d$2.dmp +$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp +$RUNSERIAL $DUMPER_BIN -p d$2 tmp_testfiles/$2 $1 $1 > log2 +$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 + +cmp -s log1 log2 || err=1 +rm -f log1 log2 +if [ $err -eq 1 ]; then +nerrors="` expr $nerrors + 1 `"; + echo "*FAILED*" +else + echo " PASSED" +fi +} + +echo "" echo "==============================" echo "H5IMPORT tests started" echo "==============================" @@ -288,30 +302,30 @@ $RUNSERIAL ./h5importtest TESTING "ASCII I32 rank 3 - Output BE " ; TOOLTEST $TESTDIR/txtin32.txt -c $TESTDIR/txtin32.conf -o txtin32.h5 -TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" +TESTING "ASCII I16 rank 3 - Output LE - CHUNKED - extended" TOOLTEST $TESTDIR/txtin16.txt -c $TESTDIR/txtin16.conf -o txtin16.h5 -TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " +TESTING "ASCII I8 - rank 3 - Output I8 LE-Chunked+Extended+Compressed " TOOLTEST $TESTDIR/txtin8.txt -c $TESTDIR/txtin8.conf -o txtin8.h5 -TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " +TESTING "ASCII UI16 - rank 2 - Output LE+Chunked+Compressed " TOOLTEST $TESTDIR/txtuin16.txt -c $TESTDIR/txtuin16.conf -o txtuin16.h5 -TESTING "ASCII UI32 - rank 3 - Output BE" +TESTING "ASCII UI32 - rank 3 - Output BE" TOOLTEST $TESTDIR/txtuin32.txt -c $TESTDIR/txtuin32.conf -o txtuin32.h5 -TESTING "ASCII F32 - rank 3 - Output LE " +TESTING "ASCII F32 - rank 3 - Output LE " TOOLTEST $TESTDIR/txtfp32.txt -c $TESTDIR/txtfp32.conf -o txtfp32.h5 -TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " +TESTING "ASCII F64 - rank 3 - Output BE + CHUNKED+Extended+Compressed " TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5 -TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " +TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5 -TESTING "H5DUMP-BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " +TESTING "H5DUMP-BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " if test $USE_FILTER_DEFLATE != "yes"; then SKIP "/fp/bin/64-bit" binfp64.h5 else @@ -319,53 +333,53 @@ else fi -TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " +TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 -TESTING "H5DUMP-BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " +TESTING "H5DUMP-BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " if test $USE_FILTER_DEFLATE != "yes"; then SKIP "/int/bin/8-bit" binin8.h5 else TOOLTEST2 "/int/bin/8-bit" binin8.h5 fi -TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " +TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5 -TESTING "H5DUMP-BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " +TESTING "H5DUMP-BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " TOOLTEST2 "/int/bin/16-bit" binin16.h5 -TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " +TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5 -TESTING "H5DUMP-BINARY I32 - rank 3 - Output BE + CHUNKED " +TESTING "H5DUMP-BINARY I32 - rank 3 - Output BE + CHUNKED " TOOLTEST2 "/int/bin/32-bit" binin32.h5 -TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " +TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o binuin16.h5 -TESTING "H5DUMP-BINARY UI16 - rank 3 - Output byte BE + CHUNKED " +TESTING "H5DUMP-BINARY UI16 - rank 3 - Output byte BE + CHUNKED " TOOLTEST2 "/int/buin/16-bit" binuin16.h5 -TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " +TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5 -TESTING "H5DUMP-BINARY UI32 - rank 3 - Output LE + CHUNKED " +TESTING "H5DUMP-BINARY UI32 - rank 3 - Output LE + CHUNKED " TOOLTEST2 "/int/buin/32-bit" binuin32.h5 -TESTING "STR" +TESTING "STR" TOOLTEST $TESTDIR/txtstr.txt -c $TESTDIR/txtstr.conf -o txtstr.h5 -TESTING "H5DUMP-STR" +TESTING "H5DUMP-STR" TOOLTEST4 "/mytext/data" txtstr.h5 -TESTING "BINARY I8 CR LF EOF" +TESTING "BINARY I8 CR LF EOF" TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5 -TESTING "H5DUMP-BINARY I8 CR LF EOF" +TESTING "H5DUMP-BINARY I8 CR LF EOF" TOOLTEST2 "/dataset0" binin8w.h5 -TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " +TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 -rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.imp *.h5 +rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.conf *.imp *.h5 rm -rf tmp_testfiles # Clean up temporary files/directories -- cgit v0.12 From 22fa1e8009e46a8730de35b209863b1abf184d2d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 13:16:40 -0500 Subject: Add subset tests to script --- tools/test/h5import/h5importtestutil.sh.in | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index 2f8c837..cca2c80 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -83,6 +83,8 @@ $SRC_H5IMPORT_TESTFILES/txtuin16.h5 $SRC_H5IMPORT_TESTFILES/txtuin32.h5 $SRC_H5IMPORT_TESTFILES/txtstr.h5 $SRC_H5IMPORT_TESTFILES/textpfe.h5 +$SRC_TOOLS_TESTFILES/tall.h5 +$SRC_TOOLS_TESTFILES/tintsattrs.h5 " LIST_OTHER_TEST_FILES=" @@ -112,6 +114,9 @@ $SRC_H5IMPORT_TESTFILES/dbinin32.h5.txt $SRC_H5IMPORT_TESTFILES/dbinuin16.h5.txt $SRC_H5IMPORT_TESTFILES/dbinuin32.h5.txt $SRC_H5IMPORT_TESTFILES/dtxtstr.h5.txt +$SRC_H5IMPORT_TESTFILES/tall_fp32.ddl +$SRC_H5IMPORT_TESTFILES/tall_i32.ddl +$SRC_H5IMPORT_TESTFILES/tintsattrs_u32.ddl " # @@ -263,10 +268,10 @@ fi TOOLTEST5() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $1 -o d$2.bin -b FILE tmp_testfiles/$2 > d$2.dmp -$RUNSERIAL $H5IMPORT_BIN d$2.bin -c d$2.dmp -o d$2 > d$2.imp -$RUNSERIAL $DUMPER_BIN -p d$2 tmp_testfiles/$2 $1 $1 > log2 -$CP -f $SRC_H5IMPORT_TESTFILES/d$2.txt log1 +$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d$1.bin -b FILE tmp_testfiles/$2 > d$1.dmp +$RUNSERIAL $H5IMPORT_BIN d$1.bin -c d$1.dmp -o d$1.h5 > d$1.imp +$RUNSERIAL $DUMPER_BIN -p d$1 d$1.h5 $1 $1 > log2 +$CP -f $SRC_H5IMPORT_TESTFILES/$1.ddl log1 cmp -s log1 log2 || err=1 rm -f log1 log2 @@ -378,6 +383,11 @@ TOOLTEST2 "/dataset0" binin8w.h5 TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 +TESTING "Binary Subset " +TOOLTEST5 tall_fp32 tall.h5 "/g2/dset2.2" "--start=1,1 --stride=2,3 --count=1,2 --block=1,1" +TOOLTEST5 tall_i32 tall.h5 "/g1/g1.1/dset1.1.1" "--start=1,1 --stride=2,3 --count=3,2 --block=1,1" +TOOLTEST5 tintsattrs_u32 tintsattrs.h5 "/DU32BITS" "--start=1,1 --stride=2,3 --count=3,2 --block=1,1" + rm -f txtin32.txt txtin16.txt txtin8.txt txtuin32.txt txtuin16.txt *.bin *.dmp *.conf *.imp *.h5 rm -rf tmp_testfiles -- cgit v0.12 From 1797bb7f5f4d29792053688f9041fd731f8d2bb4 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 14:09:32 -0500 Subject: HDFFV-10219Fix binary test to use gen files --- tools/test/h5import/h5importtestutil.sh.in | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index cca2c80..ccfd4dc 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -329,7 +329,7 @@ TOOLTEST $TESTDIR/txtfp64.txt -c $TESTDIR/txtfp64.conf -o txtfp64.h5 TESTING "BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " -TOOLTEST binfp64.bin -c $TESTDIR/binfp64.conf -o binfp64.h5 +TOOLTEST binfp64.bin -c binfp64.conf -o binfp64.h5 TESTING "H5DUMP-BINARY F64 - rank 3 - Output LE+CHUNKED+Extended+Compressed " if test $USE_FILTER_DEFLATE != "yes"; then SKIP "/fp/bin/64-bit" binfp64.h5 @@ -339,7 +339,7 @@ fi TESTING "BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " -TOOLTEST binin8.bin -c $TESTDIR/binin8.conf -o binin8.h5 +TOOLTEST binin8.bin -c binin8.conf -o binin8.h5 TESTING "H5DUMP-BINARY I8 - rank 3 - Output I16LE + Chunked+Extended+Compressed " if test $USE_FILTER_DEFLATE != "yes"; then SKIP "/int/bin/8-bit" binin8.h5 @@ -348,23 +348,23 @@ else fi TESTING "BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " -TOOLTEST binin16.bin -c $TESTDIR/binin16.conf -o binin16.h5 +TOOLTEST binin16.bin -c binin16.conf -o binin16.h5 TESTING "H5DUMP-BINARY I16 - rank 3 - Output order LE + CHUNKED + extended " TOOLTEST2 "/int/bin/16-bit" binin16.h5 TESTING "BINARY I32 - rank 3 - Output BE + CHUNKED " -TOOLTEST binin32.bin -c $TESTDIR/binin32.conf -o binin32.h5 +TOOLTEST binin32.bin -c binin32.conf -o binin32.h5 TESTING "H5DUMP-BINARY I32 - rank 3 - Output BE + CHUNKED " TOOLTEST2 "/int/bin/32-bit" binin32.h5 TESTING "BINARY UI16 - rank 3 - Output byte BE + CHUNKED " -TOOLTEST binuin16.bin -c $TESTDIR/binuin16.conf -o binuin16.h5 +TOOLTEST binuin16.bin -c binuin16.conf -o binuin16.h5 TESTING "H5DUMP-BINARY UI16 - rank 3 - Output byte BE + CHUNKED " TOOLTEST2 "/int/buin/16-bit" binuin16.h5 TESTING "BINARY UI32 - rank 3 - Output LE + CHUNKED " -TOOLTEST binuin32.bin -c $TESTDIR/binuin32.conf -o binuin32.h5 +TOOLTEST binuin32.bin -c binuin32.conf -o binuin32.h5 TESTING "H5DUMP-BINARY UI32 - rank 3 - Output LE + CHUNKED " TOOLTEST2 "/int/buin/32-bit" binuin32.h5 @@ -376,7 +376,7 @@ TOOLTEST4 "/mytext/data" txtstr.h5 TESTING "BINARY I8 CR LF EOF" -TOOLTEST binin8w.bin -c $TESTDIR/binin8w.conf -o binin8w.h5 +TOOLTEST binin8w.bin -c binin8w.conf -o binin8w.h5 TESTING "H5DUMP-BINARY I8 CR LF EOF" TOOLTEST2 "/dataset0" binin8w.h5 -- cgit v0.12 From be172e801802b9ef89bf7c40dc622b3e57a3886d Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 14:11:50 -0500 Subject: HDFFV-10219 - Fix subset test --- tools/test/h5import/h5importtestutil.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index ccfd4dc..e707737 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -270,7 +270,7 @@ TOOLTEST5() err=0 $RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d$1.bin -b FILE tmp_testfiles/$2 > d$1.dmp $RUNSERIAL $H5IMPORT_BIN d$1.bin -c d$1.dmp -o d$1.h5 > d$1.imp -$RUNSERIAL $DUMPER_BIN -p d$1 d$1.h5 $1 $1 > log2 +$RUNSERIAL $DUMPER_BIN -p d$1.h5 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/$1.ddl log1 cmp -s log1 log2 || err=1 -- cgit v0.12 From 81c5f4fe679a6e64b17bb945d6a41a56bcad68c9 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 14:33:13 -0500 Subject: HDFFV-10219 - remove debug comments --- tools/src/h5import/h5import.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index c489e09..11b46bc 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -2641,7 +2641,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2663,7 +2662,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2685,7 +2683,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2707,7 +2704,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2729,7 +2725,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2751,7 +2746,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2773,7 +2767,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2795,7 +2788,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2817,7 +2809,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2839,7 +2830,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2861,7 +2851,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2883,7 +2872,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2905,7 +2893,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2927,7 +2914,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2949,7 +2935,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -2971,7 +2956,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3113,7 +3097,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3135,7 +3118,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3157,7 +3139,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3179,7 +3160,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3256,7 +3236,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3276,7 +3255,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3296,7 +3274,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3316,7 +3293,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3336,7 +3312,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3356,7 +3331,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3376,7 +3350,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif @@ -3396,7 +3369,6 @@ static int getInputClassType(struct Input *in, char * buffer) return (-1); } in->outputByteOrder = kindex; -// in->inputByteOrder = kindex; #ifdef H5DEBUGIMPORT printf("h5dump inputByteOrder %d\n", in->inputByteOrder); #endif -- cgit v0.12 From 6b28addeca7be5662a91a3ece3988673b263e9c6 Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 14:48:47 -0500 Subject: HDFFV-10219 add test headers --- tools/test/h5import/h5importtestutil.sh.in | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index e707737..b85feae 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -383,9 +383,11 @@ TOOLTEST2 "/dataset0" binin8w.h5 TESTING "ASCII F64 - rank 1 - INPUT-CLASS TEXTFPE " TOOLTEST $TESTDIR/textpfe64.txt -c $TESTDIR/textpfe.conf -o textpfe.h5 -TESTING "Binary Subset " +TESTING "Binary Subset FP" TOOLTEST5 tall_fp32 tall.h5 "/g2/dset2.2" "--start=1,1 --stride=2,3 --count=1,2 --block=1,1" +TESTING "Binary Subset INT" TOOLTEST5 tall_i32 tall.h5 "/g1/g1.1/dset1.1.1" "--start=1,1 --stride=2,3 --count=3,2 --block=1,1" +TESTING "Binary Subset UINT" TOOLTEST5 tintsattrs_u32 tintsattrs.h5 "/DU32BITS" "--start=1,1 --stride=2,3 --count=3,2 --block=1,1" -- cgit v0.12 From 6832143610a5c213bd8547199b36ae9e82569d5b Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Thu, 15 Jun 2017 16:20:55 -0500 Subject: HDFFV-10219 - fix name templates --- tools/test/h5import/h5importtestutil.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/test/h5import/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index b85feae..fba4517 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -268,9 +268,9 @@ fi TOOLTEST5() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d$1.bin -b FILE tmp_testfiles/$2 > d$1.dmp -$RUNSERIAL $H5IMPORT_BIN d$1.bin -c d$1.dmp -o d$1.h5 > d$1.imp -$RUNSERIAL $DUMPER_BIN -p d$1.h5 > log2 +$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b FILE tmp_testfiles/$2 > d-$1.dmp +$RUNSERIAL $H5IMPORT_BIN d-$1.bin -c d-$1.dmp -o d-$1.h5 > d-$1.imp +$RUNSERIAL $DUMPER_BIN -p d-$1.h5 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/$1.ddl log1 cmp -s log1 log2 || err=1 -- cgit v0.12 From 3a637e227ccce55a9cf050dcd783f0b41f04a28f Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Jun 2017 12:04:22 -0500 Subject: HDFFFV-10219 fix file creation contention on windows --- tools/test/h5import/CMakeTests.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index aaf9052..20aad47 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -244,7 +244,7 @@ NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" -D "TEST_PROGRAM=$" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};--ddl=${testname}.dmp;-o;${testname}.bin;-b;FILE;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;FILE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testname}.dmp" -D "TEST_EXPECT=0" -- cgit v0.12 From 1ac4b918f182b6fc43e57788e9af0c4cce64efba Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Fri, 16 Jun 2017 14:03:16 -0500 Subject: HDFFV-10219 remove standard headers already included in h5private.h --- tools/src/h5import/h5import.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tools/src/h5import/h5import.c b/tools/src/h5import/h5import.c index 11b46bc..1afb383 100644 --- a/tools/src/h5import/h5import.c +++ b/tools/src/h5import/h5import.c @@ -13,11 +13,6 @@ #include "hdf5.h" #include "H5private.h" -#include -#include -#include -#include -#include #include "h5import.h" #include "h5tools.h" #include "h5tools_utils.h" -- cgit v0.12