diff --git a/release_docs/RELEASE.txt b/release_docs/RELEASE.txt index d817117810a..70e8d6e8fc0 100644 --- a/release_docs/RELEASE.txt +++ b/release_docs/RELEASE.txt @@ -769,6 +769,15 @@ Bug Fixes since HDF5-1.14.0 release Testing ------- + - Disabled running of MPI Atomicity tests for OpenMPI major versions < 5 + + Support for MPI atomicity operations is not implemented for major + versions of OpenMPI less than version 5. This would cause the MPI + atomicity tests for parallel HDF5 to sporadically fail when run + with OpenMPI. Testphdf5 now checks if OpenMPI is being used and will + skip running the atomicity tests if the major version of OpenMPI is + < 5. + - Fixed a testing failure in testphdf5 on Cray machines On some Cray machines, what appears to be a bug in Cray MPICH was causing diff --git a/test/trefer_deprec.c b/test/trefer_deprec.c index f39e93cec3b..209708bbd12 100644 --- a/test/trefer_deprec.c +++ b/test/trefer_deprec.c @@ -772,6 +772,7 @@ test_reference_region(H5F_libver_t libver_low, H5F_libver_t libver_high) CHECK(ret, FAIL, "H5Dread"); /* Try to read an unaddressed dataset */ + memset(&undef_reg, 0, sizeof(undef_reg)); dset2 = H5Rdereference2(dset1, dapl_id, H5R_DATASET_REGION, undef_reg); VERIFY(dset2, FAIL, "H5Rdereference2 haddr_undef"); diff --git a/testpar/API/t_chunk_alloc.c b/testpar/API/t_chunk_alloc.c index 37ea2faec5f..673563b4f9e 100644 --- a/testpar/API/t_chunk_alloc.c +++ b/testpar/API/t_chunk_alloc.c @@ -171,7 +171,6 @@ static void parallel_access_dataset(const char *filename, int chunk_factor, access_type action, hid_t *file_id, hid_t *dataset) { - /* HDF5 gubbins */ hid_t memspace, dataspace; /* HDF5 file identifier */ hid_t access_plist; /* HDF5 ID for file access property list */ herr_t hrc; /* HDF5 return code */ @@ -320,7 +319,6 @@ static void verify_data(const char *filename, int chunk_factor, write_type write_pattern, int vclose, hid_t *file_id, hid_t *dataset) { - /* HDF5 gubbins */ hid_t dataspace, memspace; /* HDF5 file identifier */ hid_t access_plist; /* HDF5 ID for file access property list */ herr_t hrc; /* HDF5 return code */ diff --git a/testpar/t_2Gio.c b/testpar/t_2Gio.c index e651b1b2693..1edec566aa4 100644 --- a/testpar/t_2Gio.c +++ b/testpar/t_2Gio.c @@ -4200,344 +4200,6 @@ no_collective_cause_tests(void) return; } -/* - * Test consistency semantics of atomic mode - */ - -/* - * Example of using the parallel HDF5 library to create a dataset, - * where process 0 writes and the other processes read at the same - * time. If atomic mode is set correctly, the other processes should - * read the old values in the dataset or the new ones. - */ - -void -dataset_atomicity(void) -{ - hid_t fid; /* HDF5 file ID */ - hid_t acc_tpl; /* File access templates */ - hid_t sid; /* Dataspace ID */ - hid_t dataset1; /* Dataset IDs */ - hsize_t dims[MAX_RANK]; /* dataset dim sizes */ - int *write_buf = NULL; /* data buffer */ - int *read_buf = NULL; /* data buffer */ - int buf_size; - hid_t dataset2; - hid_t file_dataspace; /* File dataspace ID */ - hid_t mem_dataspace; /* Memory dataspace ID */ - hsize_t start[MAX_RANK]; - hsize_t stride[MAX_RANK]; - hsize_t count[MAX_RANK]; - hsize_t block[MAX_RANK]; - const char *filename; - herr_t ret; /* Generic return value */ - int mpi_size, mpi_rank; - int i, j, k; - hbool_t atomicity = FALSE; - MPI_Comm comm = test_comm; - MPI_Info info = MPI_INFO_NULL; - - dim0 = 64; - dim1 = 32; - filename = GetTestParameters(); - if (facc_type != FACC_MPIO) { - printf("Atomicity tests will not work without the MPIO VFD\n"); - return; - } - if (VERBOSE_MED) - printf("atomic writes to file %s\n", filename); - - /* set up MPI parameters */ - MPI_Comm_size(test_comm, &mpi_size); - MPI_Comm_rank(test_comm, &mpi_rank); - - buf_size = dim0 * dim1; - /* allocate memory for data buffer */ - write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf calloc succeeded"); - /* allocate memory for data buffer */ - read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf calloc succeeded"); - - /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); - VRFY((acc_tpl >= 0), ""); - - /* create the file collectively */ - fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, acc_tpl); - VRFY((fid >= 0), "H5Fcreate succeeded"); - - /* Release file-access template */ - ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), "H5Pclose succeeded"); - - /* setup dimensionality object */ - dims[0] = (hsize_t)dim0; - dims[1] = (hsize_t)dim1; - sid = H5Screate_simple(MAX_RANK, dims, NULL); - VRFY((sid >= 0), "H5Screate_simple succeeded"); - - /* create datasets */ - dataset1 = H5Dcreate2(fid, DATASETNAME5, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset1 >= 0), "H5Dcreate2 succeeded"); - - dataset2 = H5Dcreate2(fid, DATASETNAME6, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - VRFY((dataset2 >= 0), "H5Dcreate2 succeeded"); - - /* initialize datasets to 0s */ - if (0 == mpi_rank) { - ret = H5Dwrite(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); - - ret = H5Dwrite(dataset2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf); - VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); - } - - ret = H5Dclose(dataset1); - VRFY((ret >= 0), "H5Dclose succeeded"); - ret = H5Dclose(dataset2); - VRFY((ret >= 0), "H5Dclose succeeded"); - ret = H5Sclose(sid); - VRFY((ret >= 0), "H5Sclose succeeded"); - ret = H5Fclose(fid); - VRFY((ret >= 0), "H5Fclose succeeded"); - - MPI_Barrier(comm); - - /* make sure setting atomicity fails on a serial file ID */ - /* file locking allows only one file open (serial) for writing */ - if (MAINPROCESS) { - fid = H5Fopen(filename, H5F_ACC_RDWR, H5P_DEFAULT); - VRFY((fid >= 0), "H5Fopen succeeded"); - } - - /* should fail */ - ret = H5Fset_mpi_atomicity(fid, TRUE); - VRFY((ret == FAIL), "H5Fset_mpi_atomicity failed"); - - if (MAINPROCESS) { - ret = H5Fclose(fid); - VRFY((ret >= 0), "H5Fclose succeeded"); - } - - MPI_Barrier(comm); - - /* setup file access template */ - acc_tpl = create_faccess_plist(comm, info, facc_type); - VRFY((acc_tpl >= 0), ""); - - /* open the file collectively */ - fid = H5Fopen(filename, H5F_ACC_RDWR, acc_tpl); - VRFY((fid >= 0), "H5Fopen succeeded"); - - /* Release file-access template */ - ret = H5Pclose(acc_tpl); - VRFY((ret >= 0), "H5Pclose succeeded"); - - ret = H5Fset_mpi_atomicity(fid, TRUE); - VRFY((ret >= 0), "H5Fset_mpi_atomicity succeeded"); - - /* open dataset1 (contiguous case) */ - dataset1 = H5Dopen2(fid, DATASETNAME5, H5P_DEFAULT); - VRFY((dataset1 >= 0), "H5Dopen2 succeeded"); - - if (0 == mpi_rank) { - for (i = 0; i < buf_size; i++) { - write_buf[i] = 5; - } - } - else { - for (i = 0; i < buf_size; i++) { - read_buf[i] = 8; - } - } - - /* check that the atomicity flag is set */ - ret = H5Fget_mpi_atomicity(fid, &atomicity); - VRFY((ret >= 0), "atomcity get failed"); - VRFY((atomicity == TRUE), "atomcity set failed"); - - MPI_Barrier(comm); - - /* Process 0 writes contiguously to the entire dataset */ - if (0 == mpi_rank) { - ret = H5Dwrite(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, write_buf); - VRFY((ret >= 0), "H5Dwrite dataset1 succeeded"); - } - /* The other processes read the entire dataset */ - else { - ret = H5Dread(dataset1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, read_buf); - VRFY((ret >= 0), "H5Dwrite() dataset multichunk write succeeded"); - } - - if (VERBOSE_MED) { - i = 0; - j = 0; - k = 0; - for (i = 0; i < dim0; i++) { - printf("\n"); - for (j = 0; j < dim1; j++) - printf("%d ", read_buf[k++]); - } - } - - /* The processes that read the dataset must either read all values - as 0 (read happened before process 0 wrote to dataset 1), or 5 - (read happened after process 0 wrote to dataset 1) */ - if (0 != mpi_rank) { - int compare = read_buf[0]; - - VRFY((compare == 0 || compare == 5), - "Atomicity Test Failed Process %d: Value read should be 0 or 5\n"); - for (i = 1; i < buf_size; i++) { - if (read_buf[i] != compare) { - printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, i, - read_buf[i], compare); - nerrors++; - } - } - } - - ret = H5Dclose(dataset1); - VRFY((ret >= 0), "H5D close succeeded"); - - /* release data buffers */ - if (write_buf) - free(write_buf); - if (read_buf) - free(read_buf); - - /* open dataset2 (non-contiguous case) */ - dataset2 = H5Dopen2(fid, DATASETNAME6, H5P_DEFAULT); - VRFY((dataset2 >= 0), "H5Dopen2 succeeded"); - - /* allocate memory for data buffer */ - write_buf = (int *)calloc((size_t)buf_size, sizeof(int)); - VRFY((write_buf != NULL), "write_buf calloc succeeded"); - /* allocate memory for data buffer */ - read_buf = (int *)calloc((size_t)buf_size, sizeof(int)); - VRFY((read_buf != NULL), "read_buf calloc succeeded"); - - for (i = 0; i < buf_size; i++) { - write_buf[i] = 5; - } - for (i = 0; i < buf_size; i++) { - read_buf[i] = 8; - } - - atomicity = FALSE; - /* check that the atomicity flag is set */ - ret = H5Fget_mpi_atomicity(fid, &atomicity); - VRFY((ret >= 0), "atomcity get failed"); - VRFY((atomicity == TRUE), "atomcity set failed"); - - block[0] = (hsize_t)(dim0 / mpi_size) - 1; - block[1] = (hsize_t)(dim1 / mpi_size) - 1; - stride[0] = block[0] + 1; - stride[1] = block[1] + 1; - count[0] = (hsize_t)mpi_size; - count[1] = (hsize_t)mpi_size; - start[0] = 0; - start[1] = 0; - - /* create a file dataspace */ - file_dataspace = H5Dget_space(dataset2); - VRFY((file_dataspace >= 0), "H5Dget_space succeeded"); - ret = H5Sselect_hyperslab(file_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - /* create a memory dataspace */ - mem_dataspace = H5Screate_simple(MAX_RANK, dims, NULL); - VRFY((mem_dataspace >= 0), ""); - - ret = H5Sselect_hyperslab(mem_dataspace, H5S_SELECT_SET, start, stride, count, block); - VRFY((ret >= 0), "H5Sset_hyperslab succeeded"); - - MPI_Barrier(comm); - - /* Process 0 writes to the dataset */ - if (0 == mpi_rank) { - ret = H5Dwrite(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, write_buf); - VRFY((ret >= 0), "H5Dwrite dataset2 succeeded"); - } - /* All processes wait for the write to finish. This works because - atomicity is set to true */ - MPI_Barrier(comm); - /* The other processes read the entire dataset */ - if (0 != mpi_rank) { - ret = H5Dread(dataset2, H5T_NATIVE_INT, mem_dataspace, file_dataspace, H5P_DEFAULT, read_buf); - VRFY((ret >= 0), "H5Dread dataset2 succeeded"); - } - - if (VERBOSE_MED) { - if (mpi_rank == 1) { - i = 0; - j = 0; - k = 0; - for (i = 0; i < dim0; i++) { - printf("\n"); - for (j = 0; j < dim1; j++) - printf("%d ", read_buf[k++]); - } - printf("\n"); - } - } - - /* The processes that read the dataset must either read all values - as 5 (read happened after process 0 wrote to dataset 1) */ - if (0 != mpi_rank) { - int compare; - i = 0; - j = 0; - k = 0; - - compare = 5; - - for (i = 0; i < dim0; i++) { - if ((hsize_t)i >= (hsize_t)mpi_rank * (block[0] + 1)) { - break; - } - if (((hsize_t)i + 1) % (block[0] + 1) == 0) { - k += dim1; - continue; - } - for (j = 0; j < dim1; j++) { - if ((hsize_t)j >= (hsize_t)mpi_rank * (block[1] + 1)) { - H5_CHECKED_ASSIGN(k, int, (hsize_t)dim1 - (hsize_t)mpi_rank * (block[1] + 1) + (hsize_t)k, - hsize_t); - break; - } - if (((hsize_t)j + 1) % (block[1] + 1) == 0) { - k++; - continue; - } - else if (compare != read_buf[k]) { - printf("Atomicity Test Failed Process %d: read_buf[%d] is %d, should be %d\n", mpi_rank, - k, read_buf[k], compare); - nerrors++; - } - k++; - } - } - } - - ret = H5Dclose(dataset2); - VRFY((ret >= 0), "H5Dclose succeeded"); - ret = H5Sclose(file_dataspace); - VRFY((ret >= 0), "H5Sclose succeeded"); - ret = H5Sclose(mem_dataspace); - VRFY((ret >= 0), "H5Sclose succeeded"); - - /* release data buffers */ - if (write_buf) - free(write_buf); - if (read_buf) - free(read_buf); - - ret = H5Fclose(fid); - VRFY((ret >= 0), "H5Fclose succeeded"); -} - /* Function: dense_attr_test * * Purpose: Test cases for writing dense attributes in parallel diff --git a/testpar/t_chunk_alloc.c b/testpar/t_chunk_alloc.c index 0ffe695fdfd..d02951d54ee 100644 --- a/testpar/t_chunk_alloc.c +++ b/testpar/t_chunk_alloc.c @@ -166,7 +166,6 @@ static void parallel_access_dataset(const char *filename, int chunk_factor, access_type action, hid_t *file_id, hid_t *dataset) { - /* HDF5 gubbins */ hid_t memspace, dataspace; /* HDF5 file identifier */ hid_t access_plist; /* HDF5 ID for file access property list */ herr_t hrc; /* HDF5 return code */ @@ -306,7 +305,6 @@ static void verify_data(const char *filename, int chunk_factor, write_type write_pattern, int vclose, hid_t *file_id, hid_t *dataset) { - /* HDF5 gubbins */ hid_t dataspace, memspace; /* HDF5 file identifier */ hid_t access_plist; /* HDF5 ID for file access property list */ herr_t hrc; /* HDF5 return code */ diff --git a/testpar/testphdf5.c b/testpar/testphdf5.c index 430b8a69884..ed0510cd55a 100644 --- a/testpar/testphdf5.c +++ b/testpar/testphdf5.c @@ -487,6 +487,14 @@ main(int argc, char **argv) AddTest((mpi_size < 2) ? "-fiodc" : "fiodc", file_image_daisy_chain_test, NULL, "file image ops daisy chain", NULL); + /* Atomicity operations are not supported for OpenMPI versions < major + * version 5 and will sporadically fail. + */ +#if defined(OPEN_MPI) && defined(OMPI_MAJOR_VERSION) && (OMPI_MAJOR_VERSION < 5) + if (MAINPROCESS) + printf("OpenMPI major version is < 5. Atomicity tests will be skipped due to support for atomicity " + "operations not being implemented.\n"); +#else if ((mpi_size < 2) && MAINPROCESS) { printf("Atomicity tests need at least 2 processes to participate\n"); printf("8 is more recommended.. Atomicity tests will be skipped \n"); @@ -497,6 +505,7 @@ main(int argc, char **argv) else if (mpi_size >= 2 && facc_type == FACC_MPIO) { AddTest("atomicity", dataset_atomicity, NULL, "dataset atomic updates", PARATESTFILE); } +#endif AddTest("denseattr", test_dense_attr, NULL, "Store Dense Attributes", PARATESTFILE); diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 97f56e0c8be..98ced407be9 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -170,14 +170,22 @@ typedef struct h5tools_dump_header_t { const char *extlinkblockend; const char *udlinkblockbegin; const char *udlinkblockend; - const char *strblockbegin; - const char *strblockend; + const char *arrblockbegin; + const char *arrblockend; + const char *cmpdblockbegin; + const char *cmpdblockend; const char *enumblockbegin; const char *enumblockend; - const char *structblockbegin; - const char *structblockend; + const char *opaqblockbegin; + const char *opaqblockend; + const char *refblockbegin; + const char *refblockend; + const char *strblockbegin; + const char *strblockend; const char *vlenblockbegin; const char *vlenblockend; + const char *structblockbegin; + const char *structblockend; const char *subsettingblockbegin; const char *subsettingblockend; const char *startblockbegin; diff --git a/tools/lib/h5tools_dump.c b/tools/lib/h5tools_dump.c index e1fab359145..2986de7d395 100644 --- a/tools/lib/h5tools_dump.c +++ b/tools/lib/h5tools_dump.c @@ -127,46 +127,54 @@ const h5tools_dump_header_t h5tools_standardformat = { BLOCK, /*blockbegin */ "", /*blockend */ - "{", /*fileblockbegin */ - "}", /*fileblockend */ - "{", /*bootblockblockbegin */ - "}", /*bootblockblockend */ - "{", /*groupblockbegin */ - "}", /*groupblockend */ - "{", /*datasetblockbegin */ - "}", /*datasetblockend */ - "{", /*attributeblockbegin */ - "}", /*attributeblockend */ - "", /*datatypeblockbegin */ - "", /*datatypeblockend */ - "", /*dataspaceblockbegin */ - "", /*dataspaceblockend */ - "{", /*datablockbegin */ - "}", /*datablockend */ - "{", /*softlinkblockbegin */ - "}", /*softlinkblockend */ - "{", /*extlinkblockbegin */ - "}", /*extlinkblockend */ - "{", /*udlinkblockbegin */ - "}", /*udlinkblockend */ - "{", /*strblockbegin */ - "}", /*strblockend */ - "{", /*enumblockbegin */ - "}", /*enumblockend */ - "{", /*structblockbegin */ - "}", /*structblockend */ - "{", /*vlenblockbegin */ - "}", /*vlenblockend */ - "{", /*subsettingblockbegin */ - "}", /*subsettingblockend */ - "(", /*startblockbegin */ - ");", /*startblockend */ - "(", /*strideblockbegin */ - ");", /*strideblockend */ - "(", /*countblockbegin */ - ");", /*countblockend */ - "(", /*blockblockbegin */ - ");", /*blockblockend */ + "{", /*fileblockbegin */ + "}", /*fileblockend */ + "{", /*bootblockblockbegin */ + "}", /*bootblockblockend */ + "{", /*groupblockbegin */ + "}", /*groupblockend */ + "{", /*datasetblockbegin */ + "}", /*datasetblockend */ + "{", /*attributeblockbegin */ + "}", /*attributeblockend */ + "", /*datatypeblockbegin */ + "", /*datatypeblockend */ + "", /*dataspaceblockbegin */ + "", /*dataspaceblockend */ + "{", /*datablockbegin */ + "}", /*datablockend */ + "{", /*softlinkblockbegin */ + "}", /*softlinkblockend */ + "{", /*extlinkblockbegin */ + "}", /*extlinkblockend */ + "{", /*udlinkblockbegin */ + "}", /*udlinkblockend */ + "H5T_ARRAY { ", /*arrblockbegin */ + " }", /*arrblockend */ + "H5T_COMPOUND {", /*cmpdblockbegin */ + "}", /*cmpdblockend */ + "H5T_ENUM {", /*enumblockbegin */ + "}", /*enumblockend */ + "H5T_OPAQUE {", /*opaqblockbegin */ + "}", /*opaqblockend */ + "H5T_REFERENCE { ", /*refblockbegin */ + " }", /*refblockend */ + "H5T_STRING {", /*strblockbegin */ + "}", /*strblockend */ + "H5T_VLEN { ", /*vlenblockbegin */ + " }", /*vlenblockend */ + "{", /*structblockbegin */ + "}", /*structblockend */ + "{", /*subsettingblockbegin */ + "}", /*subsettingblockend */ + "(", /*startblockbegin */ + ");", /*startblockend */ + "(", /*strideblockbegin */ + ");", /*strideblockend */ + "(", /*countblockbegin */ + ");", /*countblockend */ + "(", /*blockblockbegin */ + ");", /*blockblockend */ "", /*dataspacedescriptionbegin */ "", /*dataspacedescriptionend */ @@ -2236,7 +2244,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ is_vlstr = H5Tis_variable_str(tmp_type); curr_pos = ctx->cur_column; - h5tools_str_append(buffer, "H5T_STRING %s", h5tools_dump_header_format->strblockbegin); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->strblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2440,7 +2448,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ break; case H5T_OPAQUE: - h5tools_str_append(buffer, "H5T_OPAQUE %s", h5tools_dump_header_format->structblockbegin); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->opaqblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level++; @@ -2473,7 +2481,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->need_prefix = TRUE; h5tools_str_reset(buffer); - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->opaqblockend); break; case H5T_COMPOUND: @@ -2481,7 +2489,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ H5TOOLS_THROW((-1), "H5Tget_nmembers failed"); nmembers = (unsigned)snmembers; - h5tools_str_append(buffer, "H5T_COMPOUND %s", h5tools_dump_header_format->structblockbegin); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->cmpdblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); @@ -2509,30 +2517,31 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ ctx->need_prefix = TRUE; h5tools_str_reset(buffer); - h5tools_str_append(buffer, "%s", h5tools_dump_header_format->structblockend); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->cmpdblockend); break; case H5T_REFERENCE: - h5tools_str_append(buffer, "H5T_REFERENCE"); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->refblockbegin); if (H5Tequal(type, H5T_STD_REF_DSETREG) == TRUE) { - h5tools_str_append(buffer, " { H5T_STD_REF_DSETREG }"); + h5tools_str_append(buffer, "H5T_STD_REF_DSETREG"); } else if (H5Tequal(type, H5T_STD_REF_OBJ) == TRUE) { - h5tools_str_append(buffer, " { H5T_STD_REF_OBJECT }"); + h5tools_str_append(buffer, "H5T_STD_REF_OBJECT"); } else if (H5Tequal(type, H5T_STD_REF) == TRUE) { - h5tools_str_append(buffer, " { H5T_STD_REF }"); + h5tools_str_append(buffer, "H5T_STD_REF"); } else { - h5tools_str_append(buffer, " { UNDEFINED }"); + h5tools_str_append(buffer, "UNDEFINED"); } + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->refblockend); break; case H5T_ENUM: if ((super = H5Tget_super(type)) < 0) H5TOOLS_THROW((-1), "H5Tget_super failed"); - h5tools_str_append(buffer, "H5T_ENUM %s", h5tools_dump_header_format->enumblockbegin); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->enumblockbegin); h5tools_render_element(stream, info, ctx, buffer, &curr_pos, (size_t)ncols, (hsize_t)0, (hsize_t)0); ctx->indent_level++; @@ -2564,19 +2573,19 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ if ((super = H5Tget_super(type)) < 0) H5TOOLS_THROW((-1), "H5Tget_super failed"); - h5tools_str_append(buffer, "H5T_VLEN %s ", h5tools_dump_header_format->vlenblockbegin); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockbegin); h5tools_print_datatype(stream, buffer, info, ctx, super, TRUE); if (H5Tclose(super) < 0) H5TOOLS_ERROR((-1), "H5Tclose failed"); - h5tools_str_append(buffer, " %s", h5tools_dump_header_format->vlenblockend); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->vlenblockend); break; case H5T_ARRAY: - h5tools_str_append(buffer, "H5T_ARRAY { "); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->arrblockbegin); /* Get array information */ if ((sndims = H5Tget_array_ndims(type)) >= 0) { @@ -2606,7 +2615,7 @@ h5tools_print_datatype(FILE *stream, h5tools_str_t *buffer, const h5tool_format_ else H5TOOLS_ERROR((-1), "H5Tget_super failed"); - h5tools_str_append(buffer, " }"); + h5tools_str_append(buffer, "%s", h5tools_dump_header_format->arrblockend); break; diff --git a/tools/src/h5repack/h5repack_copy.c b/tools/src/h5repack/h5repack_copy.c index 81b33c3093f..2d0819b1fa3 100644 --- a/tools/src/h5repack/h5repack_copy.c +++ b/tools/src/h5repack/h5repack_copy.c @@ -810,6 +810,10 @@ do_copy_objects(hid_t fidin, hid_t fidout, trav_table_t *travt, pack_opt_t *opti /* early detection of variable-length types */ if ((is_vlen = H5Tdetect_class(ftype_id, H5T_VLEN)) < 0) H5TOOLS_GOTO_ERROR((-1), "H5Tdetect_class failed"); + if (!is_vlen) { + if ((is_vlen = H5Tis_variable_str(ftype_id)) < 0) + H5TOOLS_GOTO_ERROR((-1), "H5Tis_variable_str failed"); + } /* Check if the datatype is committed */ if ((is_named = H5Tcommitted(ftype_id)) < 0)